-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from pablo19sc/main
Adding AWS RAM share support (VPC Lattice service networks and services)
- Loading branch information
Showing
19 changed files
with
273 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.1.0 | ||
v0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Amazon VPC Lattice - Example: AWS RAM share | ||
|
||
This example shows how you can use the VPC Lattice module to share service networks and services using [AWS Resource Access Manager](https://aws.amazon.com/ram/) RAM. The example creates the following: | ||
|
||
* 1 VPC Lattice service network. | ||
* 3 VPC Lattice services - basic configuration (without listeners or targets). | ||
* 2 RAM shares. One is sharing the service network, and the other one is sharing 2 out of the 3 VPC Lattice services created. | ||
|
||
**NOTE**: Given we automate these examples before merging new PRs, there's an [AWS Systems Manager parameter](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) data source configured to obtain an Account ID from a parameter configured in the AWS Account we use for the automated tests. Take that into account when doing your own tests, and please remember to keep this configuration when doing any PR to this repository. | ||
|
||
In the `outputs.tf` file, you can see an example on how to obtain the information about the RAM share created (if applicable). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
# Amazon VPC Lattice - Example: AWS RAM share | ||
|
||
This example shows how you can use the VPC Lattice module to share service networks and services using [AWS Resource Access Manager](https://aws.amazon.com/ram/) RAM. The example creates the following: | ||
|
||
* 1 VPC Lattice service network. | ||
* 3 VPC Lattice services - basic configuration (without listeners or targets). | ||
* 2 RAM shares. One is sharing the service network, and the other one is sharing 2 out of the 3 VPC Lattice services created. | ||
|
||
**NOTE**: Given we automate these examples before merging new PRs, there's an [AWS Systems Manager parameter](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) data source configured to obtain an Account ID from a parameter configured in the AWS Account we use for the automated tests. Take that into account when doing your own tests, and please remember to keep this configuration when doing any PR to this repository. | ||
|
||
In the `outputs.tf` file, you can see an example on how to obtain the information about the RAM share created (if applicable). | ||
|
||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 | | ||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66.0 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66.0 | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_vpclattice_service_network_share"></a> [vpclattice\_service\_network\_share](#module\_vpclattice\_service\_network\_share) | ../.. | n/a | | ||
| <a name="module_vpclattice_services_share"></a> [vpclattice\_services\_share](#module\_vpclattice\_services\_share) | ../.. | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_ram_resource_share.vpclattice_resource_share](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ram_resource_share) | resource | | ||
| [aws_ssm_parameter.account_id](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS Region to use. | `string` | `"eu-west-1"` | no | | ||
|
||
## Outputs | ||
|
||
No outputs. | ||
<!-- END_TF_DOCS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# --- examples/ram_share/main.tf --- | ||
|
||
# Obtaining the AWS Account ID to share the resources with. | ||
# If you are testing outside the module automation, either change this value with an AWS Account you own, or create a Parameter with this value | ||
data "aws_ssm_parameter" "account_id" { | ||
name = "account_id_share" | ||
} | ||
|
||
module "vpclattice_service_network_share" { | ||
source = "../.." | ||
|
||
service_network = { | ||
name = "service-network" | ||
auth_type = "NONE" | ||
} | ||
|
||
ram_share = { | ||
resource_share_name = "service-network-resource-share" | ||
allow_external_principals = true | ||
principals = [data.aws_ssm_parameter.account_id.value] | ||
} | ||
} | ||
|
||
module "vpclattice_services_share" { | ||
source = "../.." | ||
|
||
services = { | ||
service1 = { | ||
name = "service1" | ||
auth_type = "NONE" | ||
} | ||
service2 = { | ||
name = "service2" | ||
auth_type = "NONE" | ||
} | ||
service3 = { | ||
name = "service3" | ||
auth_type = "NONE" | ||
} | ||
} | ||
|
||
ram_share = { | ||
resource_share_arn = aws_ram_resource_share.vpclattice_resource_share.arn | ||
principals = [data.aws_ssm_parameter.account_id.value] | ||
share_services = ["service1", "service2"] | ||
} | ||
} | ||
|
||
resource "aws_ram_resource_share" "vpclattice_resource_share" { | ||
name = "services-resource-share" | ||
allow_external_principals = true | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# --- examples/ram_share/outputs.tf --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# --- examples/ram_share/providers.tf --- | ||
|
||
terraform { | ||
required_version = ">= 1.3.0" | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 4.66.0" | ||
} | ||
} | ||
} | ||
|
||
# Provider definition | ||
provider "aws" { | ||
region = var.aws_region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# --- examples/ram_share/variables.tf --- | ||
|
||
variable "aws_region" { | ||
type = string | ||
description = "AWS Region to use." | ||
default = "eu-west-1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
run "plan_ram_share" { | ||
command = plan | ||
module { | ||
source = "./examples/ram_share" | ||
} | ||
} | ||
|
||
run "apply_ram_share" { | ||
command = apply | ||
module { | ||
source = "./examples/ram_share" | ||
} | ||
} |
Oops, something went wrong.