From 3205d8919f7a9e8661c04d48c64b5386218995d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emir=20=C3=96zbir?= Date: Tue, 26 Nov 2019 21:49:39 +0300 Subject: [PATCH 1/2] updated profile rather than secrets --- deployments/poc-aws/main.tf | 3 +-- deployments/poc-aws/variables.tf | 10 ---------- deployments/pro/main.tf | 4 ++-- deployments/pro/variables.tf | 10 ---------- 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/deployments/poc-aws/main.tf b/deployments/poc-aws/main.tf index 15cdd78..aa6616b 100644 --- a/deployments/poc-aws/main.tf +++ b/deployments/poc-aws/main.tf @@ -14,8 +14,7 @@ locals { provider "aws" { version = "~> 1.60" region = "${var.aws_region}" - access_key = "${var.aws_access_key}" - secret_key = "${var.aws_secret_key}" + profile = "${var.profile}" } resource "random_string" "gateway_secret" { diff --git a/deployments/poc-aws/variables.tf b/deployments/poc-aws/variables.tf index cb81e2c..0c515dc 100644 --- a/deployments/poc-aws/variables.tf +++ b/deployments/poc-aws/variables.tf @@ -3,16 +3,6 @@ variable "aws_region" { description = "AWS region to use for Tyk deployment" } -variable "aws_access_key" { - type = "string" - description = "AWS access key to use for Tyk deployment" -} - -variable "aws_secret_key" { - type = "string" - description = "AWS secret key to use for Tyk deployment" -} - variable "aws_azs" { type = "list" description = "AWS availability zones for Tyk deployment" diff --git a/deployments/pro/main.tf b/deployments/pro/main.tf index b48b940..b50fa76 100644 --- a/deployments/pro/main.tf +++ b/deployments/pro/main.tf @@ -7,8 +7,8 @@ locals { provider "aws" { version = "~> 1.60" region = "${var.aws_region}" - access_key = "${var.aws_access_key}" - secret_key = "${var.aws_secret_key}" + profile = "${var.profile}" + } resource "random_string" "gateway_secret" { diff --git a/deployments/pro/variables.tf b/deployments/pro/variables.tf index f6d2511..f49e0c5 100644 --- a/deployments/pro/variables.tf +++ b/deployments/pro/variables.tf @@ -3,16 +3,6 @@ variable "aws_region" { description = "AWS region to use for Tyk deployment" } -variable "aws_access_key" { - type = "string" - description = "AWS access key to use for Tyk deployment" -} - -variable "aws_secret_key" { - type = "string" - description = "AWS secret key to use for Tyk deployment" -} - variable "vpc_id" { type = "string" description = "VPC to use for Tyk deployment" From 3b02faaa0d429829eb350acf7b08b9773894cac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emir=20=C3=96zbir?= Date: Tue, 26 Nov 2019 23:30:05 +0300 Subject: [PATCH 2/2] README updated for authentication --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 1868cb8..56cbe48 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,13 @@ See more at: Full deployment examples are available in the deployments directory. +## Access AWS Resources via TYK Terraform Modules +This modules include AWS as a cloud provider, so that if you want to access resources, you should add you credentials tou your `~/.aws/credentials` shown as below ; + +``` +[myprofile] +aws_access_key_id = AWS_ACCESS_KEY_ID +aws_secret_access_key = AWS_SECRET_KEY_ID + +``` +and than you set the `my_profile` to the profile_name variable .