Configuration in this directory creates two security groups using native Terraform resources, and then uses the module to add rules.
Data sources are used to discover existing VPC resources (VPC and default security group).
To run this example you need to execute:
$ terraform init
$ terraform plan
$ terraform apply
Note that this example may create resources which cost money. Run terraform destroy
when you don't need these resources.
Name | Version |
---|---|
terraform | >= 1.0 |
aws | >= 3.29 |
Name | Version |
---|---|
aws | >= 3.29 |
Name | Source | Version |
---|---|---|
rules_one | ../../ | n/a |
rules_two | ../../ | n/a |
Name | Type |
---|---|
aws_security_group.service_one | resource |
aws_security_group.service_two | resource |
aws_security_group.default | data source |
aws_vpc.default | data source |
No inputs.
Name | Description |
---|---|
service_one_security_group_arn | The ARN of the security group for service one |
service_one_security_group_id | The ID of the security group for service one |
service_tow_security_group_arn | The ARN of the security group for service two |
service_two_security_group_id | The ID of the security group for service two |