File tree Expand file tree Collapse file tree 19 files changed +562
-0
lines changed
Expand file tree Collapse file tree 19 files changed +562
-0
lines changed Original file line number Diff line number Diff line change 1818 name : Module Validation
1919 with :
2020 working-directory : .
21+
22+ shared-module-validation :
23+ uses : appvia/appvia-cicd-workflows/.github/workflows/terraform-module-validation.yml@main
24+ name : Shared Module Validation
25+ with :
26+ working-directory : modules/shared
27+
28+ ram-module-validation :
29+ uses : appvia/appvia-cicd-workflows/.github/workflows/terraform-module-validation.yml@main
30+ name : RAM Module Validation
31+ with :
32+ working-directory : modules/ram
33+
34+ ram-principal-associations :
35+ uses : appvia/appvia-cicd-workflows/.github/workflows/terraform-module-validation.yml@main
36+ name : RAM Principal Associations
37+ with :
38+ working-directory : modules/ram_associations
39+
40+ ram-resource-associations :
41+ uses : appvia/appvia-cicd-workflows/.github/workflows/terraform-module-validation.yml@main
42+ name : RAM Resource Associations
43+ with :
44+ working-directory : modules/ram_resources
Original file line number Diff line number Diff line change 1+
2+ # # Provision a RAM resource share
3+ resource "aws_ram_resource_share" "this" {
4+ name = var. name
5+ tags = var. tags
6+ allow_external_principals = var. allow_external_principals
7+ }
8+
9+ # # Associate the resources to the resource share
10+ module "resource_associations" {
11+ source = " ../ram_resources"
12+ for_each = { for resource in var . resources : resource . name => resource }
13+
14+ resource_arn = each. value . resource_arn
15+ resource_share_arn = aws_ram_resource_share. this . arn
16+ }
17+
18+ # # Associate the principals to the resource share
19+ module "principal_associations" {
20+ source = " ../ram_associations"
21+ for_each = toset (var. principals )
22+
23+ principal = each. value
24+ resource_share_arn = aws_ram_resource_share. this . arn
25+ }
Original file line number Diff line number Diff line change 1+
2+ terraform {
3+ required_version = " >= 1.0"
4+
5+ required_providers {
6+ aws = {
7+ source = " hashicorp/aws"
8+ version = " ~> 5.0"
9+ }
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ variable "name" {
2+ description = " Name of the resource share"
3+ type = string
4+ }
5+
6+ variable "allow_external_principals" {
7+ description = " Allow external principals to associate with the resource share."
8+ type = bool
9+ default = false
10+ }
11+
12+ variable "principals" {
13+ description = " List of principals to associate with the resource share."
14+ type = list (string )
15+ default = []
16+ }
17+
18+ variable "resources" {
19+ description = " Schema list of resources to associate to the resource share"
20+ type = list (object ({
21+ name = string
22+ resource_arn = string
23+ }))
24+ default = []
25+ }
26+
27+ variable "tags" {
28+ description = " Map of tags to assign to the resource share"
29+ type = map (string )
30+ }
Original file line number Diff line number Diff line change 1+
2+ resource "aws_ram_principal_association" "this" {
3+ principal = var. principal
4+ resource_share_arn = var. resource_share_arn
5+ }
Original file line number Diff line number Diff line change 1+ output "principal_association" {
2+ description = " Object with the AWS RAM principal association resource"
3+ value = aws_ram_principal_association. this
4+ }
Original file line number Diff line number Diff line change 1+
2+ terraform {
3+ required_version = " >= 1.0"
4+
5+ required_providers {
6+ aws = {
7+ source = " hashicorp/aws"
8+ version = " ~> 5.0"
9+ }
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ variable "principal" {
2+ description = " The principal to associate with the resource share."
3+ type = string
4+ }
5+
6+ variable "resource_share_arn" {
7+ description = " ARN of the resource share"
8+ type = string
9+ }
Original file line number Diff line number Diff line change 1+ # # Associate the principal to the resource share
2+ resource "aws_ram_resource_association" "this" {
3+ resource_arn = var. resource_arn
4+ resource_share_arn = var. resource_share_arn
5+ }
You can’t perform that action at this time.
0 commit comments