(MODE-11365) Setup aws creds to fetch artifact.

This commit is contained in:
Sokratis Siozos-Drosos 2019-04-24 18:48:49 +02:00
parent 6605f662bd
commit 602192e14e
4 changed files with 18 additions and 1 deletions

View file

@ -40,6 +40,8 @@ data "template_file" "shell-script" {
mono_region = "${var.mono_region}" mono_region = "${var.mono_region}"
repo_version = "${var.repo_version}" repo_version = "${var.repo_version}"
environment = "${var.environment}" environment = "${var.environment}"
aws_access_key = "${var.aws_access_key}"
aws_secret_key = "${var.aws_secret_key}"
} }
} }

View file

@ -5,6 +5,8 @@ REGION=${region}
ENVIRONMENT=${environment} ENVIRONMENT=${environment}
MONO_REGION=${mono_region} MONO_REGION=${mono_region}
REPO_VERSION=${repo_version} REPO_VERSION=${repo_version}
AWS_ACCESS_KEY=${aws_access_key}
AWS_SECRET_KEY=${aws_secret_key}
BUCKET="mono-deployment-$ENVIRONMENT" BUCKET="mono-deployment-$ENVIRONMENT"
DEPLOYABLE="tileserver-gl-$REPO_VERSION.tar.gz" DEPLOYABLE="tileserver-gl-$REPO_VERSION.tar.gz"
FULL_BUCKET_URI="s3://$BUCKET/tileserver-gl/$DEPLOYABLE" FULL_BUCKET_URI="s3://$BUCKET/tileserver-gl/$DEPLOYABLE"
@ -23,6 +25,9 @@ REGION=$REGION
ENVIRONMENT=$ENVIRONMENT ENVIRONMENT=$ENVIRONMENT
MONO_REGION=$MONO_REGION MONO_REGION=$MONO_REGION
EOL EOL
aws configure set aws_access_key_id "$AWS_ACCESS_KEY"
aws configure set aws_secret_access_key "$AWS_SECRET_KEY"
aws configure set region "$REGION"
sudo rm /etc/apt/sources.list.d/microsoft.list sudo rm /etc/apt/sources.list.d/microsoft.list
sudo groupadd nginx sudo groupadd nginx
sudo useradd nginx -g nginx sudo useradd nginx -g nginx

View file

@ -1,5 +1,5 @@
resource "aws_alb_target_group" "target_group_this" { resource "aws_alb_target_group" "target_group_this" {
name = "maps" name = "maps-test"
port = "80" port = "80"
protocol = "HTTP" protocol = "HTTP"
vpc_id = "${data.terraform_remote_state.mono_vpc.vpc_id[0]}" vpc_id = "${data.terraform_remote_state.mono_vpc.vpc_id[0]}"

View file

@ -54,3 +54,13 @@ variable "repo_version" {
type = "string" type = "string"
description = "Version of repo to fetch and setup from S3" description = "Version of repo to fetch and setup from S3"
} }
variable "aws_access_key" {
type = "string"
description = "AWS access creds to fetch artifact"
}
variable "aws_secret_key" {
type = "string"
description = "AWS access secret to fetch artifact"
}