Skip to content

Commit

Permalink
Add option to skip ec2 profile credentials (#27)
Browse files Browse the repository at this point in the history
* Add option to skip ec2 profile credentials

* Updated README.md

Co-authored-by: actions-bot <[email protected]>
  • Loading branch information
Peng Yin and actions-bot committed Oct 21, 2020
1 parent 3797458 commit 18e5563
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ Available targets:
| requester\_subnet\_tags | Only add peer routes to requester VPC route tables of subnets matching these tags | `map(string)` | `{}` | no |
| requester\_vpc\_id | Requester VPC ID filter | `string` | `""` | no |
| requester\_vpc\_tags | Requester VPC Tags filter | `map(string)` | `{}` | no |
| skip\_metadata\_api\_check | Don't use the credentials of EC2 instance profile | `bool` | `false` | no |
| stage | Stage (e.g. `prod`, `dev`, `staging`) | `string` | n/a | yes |
| tags | Additional tags (e.g. `{"BusinessUnit" = "XYZ"`) | `map(string)` | `{}` | no |

Expand Down
5 changes: 3 additions & 2 deletions accepter.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Accepter's credentials
provider "aws" {
alias = "accepter"
region = var.accepter_region
alias = "accepter"
region = var.accepter_region
skip_metadata_api_check = var.skip_metadata_api_check

dynamic "assume_role" {
for_each = var.accepter_aws_assume_role_arn != "" ? ["true"] : []
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
| requester\_subnet\_tags | Only add peer routes to requester VPC route tables of subnets matching these tags | `map(string)` | `{}` | no |
| requester\_vpc\_id | Requester VPC ID filter | `string` | `""` | no |
| requester\_vpc\_tags | Requester VPC Tags filter | `map(string)` | `{}` | no |
| skip\_metadata\_api\_check | Don't use the credentials of EC2 instance profile | `bool` | `false` | no |
| stage | Stage (e.g. `prod`, `dev`, `staging`) | `string` | n/a | yes |
| tags | Additional tags (e.g. `{"BusinessUnit" = "XYZ"`) | `map(string)` | `{}` | no |

Expand Down
5 changes: 3 additions & 2 deletions requester.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ variable "requester_allow_remote_vpc_dns_resolution" {

# Requestors's credentials
provider "aws" {
alias = "requester"
region = var.requester_region
alias = "requester"
region = var.requester_region
skip_metadata_api_check = var.skip_metadata_api_check

dynamic "assume_role" {
for_each = var.requester_aws_assume_role_arn != "" ? ["true"] : []
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ variable "accepter_allow_remote_vpc_dns_resolution" {
default = true
description = "Allow accepter VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the requester VPC"
}

variable "skip_metadata_api_check" {
type = bool
default = false
description = "Don't use the credentials of EC2 instance profile"
}

0 comments on commit 18e5563

Please sign in to comment.