Skip to content

Commit

Permalink
update sample code for awscc provider
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jun 5, 2024
1 parent ed50508 commit 5684390
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 17 deletions.
10 changes: 10 additions & 0 deletions examples/region-shared-setup/credentials.network_account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ provider "aws" {
session_name = var.os_username
}
}

provider "awscc" {
alias = "network_account"
region = var.region
profile = var.profile
assume_role = {
role_arn = var.network_role_arn
session_name = var.os_username
}
}
21 changes: 21 additions & 0 deletions examples/region-shared-setup/provider.awscc.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# default: east
provider "awscc" {
region = var.region_map["east"]
profile = var.profile
}

# other regions
# east
provider "awscc" {
alias = "east"
region = var.region_map["east"]
profile = var.profile
}

# west
provider "awscc" {
alias = "west"
region = var.region_map["west"]
profile = var.profile
}

6 changes: 4 additions & 2 deletions examples/region-shared-setup/tags.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module "tag_shared" {
source = "git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//tag-shared-vpc-resources?ref=tf-upgrade"
providers = {
aws = aws
aws.network_account = aws.network_account
aws = aws
aws.network_account = aws.network_account
awscc = awscc
awscc.network_account = awscc.network_account
}
profile = var.profile
role_arn = var.network_role_arn
Expand Down
16 changes: 2 additions & 14 deletions examples/region-shared-setup/tf-run.data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION 1.1.0
VERSION 2.1.2
TAG setup
REMOTE-STATE
COMMAND tf-directory-setup.py -l none -f
Expand All @@ -17,21 +17,9 @@ LINKTOP includes.d/variables.application_tags.auto.tfvars
COMMAND rm -f provider.ldap.* provider.ldap_new.*

TAG init
COMMAND tf-init -upgrade
COMMAND tf-init

TAG start

TAG tags
module.tag_shared.aws_ec2_tag.vpcs module.tag_shared.aws_ec2_tag.dhcp_options
module.tag_shared.aws_ec2_tag.route_tables module.tag_shared.aws_ec2_tag.subnets
module.tag_shared.aws_ec2_tag.transit_gateway

TAG network-acls
module.tag_shared.null_resource.setup_directory
module.tag_shared.null_resource.network_acl
module.tag_shared.null_resource.network_acls

TAG remainder
ALL

TAG state-link
Expand Down
6 changes: 5 additions & 1 deletion examples/region-shared-setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 5.0"
}
awscc = {
source = "hashicorp/awscc"
version = ">= 1.0"
}
## ldap = {
## source = "trevex/ldap"
Expand Down

0 comments on commit 5684390

Please sign in to comment.