Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
snovikov committed Sep 12, 2024
1 parent 69dc442 commit 54f6b68
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ jobs:

- name: "make test"
run: |
make test ARGS="-var allowed_account_id=${TF_VAR_allowed_account_id} -var role_to_assume=${TF_VAR_role_to_assume}"
make test ARGS="-var allowed_account_id=${TF_VAR_allowed_account_id} -var role_to_assume=${TF_VAR_role_to_assume} -var transit_gateway_satellite_account_id=${TF_VAR_satellite_account_id}"
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_VAR_allowed_account_id: ${{ secrets.allowed_account_id }}
TF_VAR_role_to_assume: ${{ secrets.role_to_assume }}
TF_VAR_allowed_account_id: ${{ secrets.AWS_ACCOUNT_ID_HUB }}
TF_VAR_role_to_assume: ${{ secrets.ROLE_TO_ASSUME }}
TF_VAR_satellite_account_id: ${{ secrets.AWS_ACCOUNT_ID_SATELLITE }}
7 changes: 4 additions & 3 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:

- name: "make test"
run: |
make test ARGS="-var allowed_account_id=${TF_VAR_allowed_account_id} -var role_to_assume=${TF_VAR_role_to_assume}"
make test ARGS="-var allowed_account_id=${TF_VAR_allowed_account_id} -var role_to_assume=${TF_VAR_role_to_assume} -var transit_gateway_satellite_account_id=${TF_VAR_satellite_account_id}"
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_VAR_allowed_account_id: ${{ secrets.allowed_account_id }}
TF_VAR_role_to_assume: ${{ secrets.role_to_assume }}
TF_VAR_allowed_account_id: ${{ secrets.AWS_ACCOUNT_ID_HUB }}
TF_VAR_role_to_assume: ${{ secrets.ROLE_TO_ASSUME }}
TF_VAR_satellite_account_id: ${{ secrets.AWS_ACCOUNT_ID_SATELLITE }}
1 change: 1 addition & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ No resources.
| <a name="input_cgw_ip_address"></a> [cgw\_ip\_address](#input\_cgw\_ip\_address) | IP address of the client VPN endpoint | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | Generic name to be given to the provisioned resources | `string` | n/a | yes |
| <a name="input_transit_gateway_hub_name"></a> [transit\_gateway\_hub\_name](#input\_transit\_gateway\_hub\_name) | Name of the Transit Gateway to attach the VPN to | `string` | n/a | yes |
| <a name="input_transit_gateway_satellite_account_id"></a> [transit\_gateway\_satellite\_account\_id](#input\_transit\_gateway\_satellite\_account\_id) | AWS account ID for which the module should share TGW resource | `string` | n/a | yes |
| <a name="input_role_to_assume"></a> [role\_to\_assume](#input\_role\_to\_assume) | IAM role name to assume (eg. ASSUME-ROLE-HUB) | `string` | `""` | no |
| <a name="input_static_routes_destinations"></a> [static\_routes\_destinations](#input\_static\_routes\_destinations) | List of CIDRs to be routed into the VPN tunnel. | `list(string)` | `[]` | no |
| <a name="input_static_routes_only"></a> [static\_routes\_only](#input\_static\_routes\_only) | Whether the VPN connection uses static routes exclusively. Static routes must be used for devices that don't support BGP | `bool` | `false` | no |
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module "tgw" {
name = var.transit_gateway_hub_name

aws_account_id_hub = var.allowed_account_id
aws_account_id_satellite = []
aws_account_id_satellite = [var.transit_gateway_satellite_account_id]
}

module "vpn" {
Expand Down
5 changes: 5 additions & 0 deletions examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ variable "transit_gateway_hub_name" {
type = string
}

variable "transit_gateway_satellite_account_id" {
description = "AWS account ID for which the module should share TGW resource"
type = string
}

variable "static_routes_only" {
description = "Whether the VPN connection uses static routes exclusively. Static routes must be used for devices that don't support BGP"
type = bool
Expand Down

0 comments on commit 54f6b68

Please sign in to comment.