diff --git a/.github/auto-release.yml b/.github/auto-release.yml index 9976e10..b45efb7 100644 --- a/.github/auto-release.yml +++ b/.github/auto-release.yml @@ -47,7 +47,7 @@ template: | replacers: # Remove irrelevant information from Renovate bot -- search: '/(?<=---\s+)+^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm' +- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm' replace: '' # Remove Renovate bot banner image - search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm' diff --git a/LICENSE b/LICENSE index e17aa36..2a169cc 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020 Cloud Posse, LLC + Copyright 2021-2022 Cloud Posse, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 2bd5490..d1871ea 100644 --- a/README.md +++ b/README.md @@ -652,14 +652,18 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply ### Contributors -| [![Erik Osterman][osterman_avatar]][osterman_homepage]
[Erik Osterman][osterman_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]
[Vladimir][SweetOps_homepage] | -|---|---| +| [![Erik Osterman][osterman_avatar]][osterman_homepage]
[Erik Osterman][osterman_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]
[Vladimir][SweetOps_homepage] | [![RB][nitrocode_avatar]][nitrocode_homepage]
[RB][nitrocode_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]
[Andriy Knysh][aknysh_homepage] | +|---|---|---|---| [osterman_homepage]: https://github.com/osterman [osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png [SweetOps_homepage]: https://github.com/SweetOps [SweetOps_avatar]: https://img.cloudposse.com/150x150/https://github.com/SweetOps.png + [nitrocode_homepage]: https://github.com/nitrocode + [nitrocode_avatar]: https://img.cloudposse.com/150x150/https://github.com/nitrocode.png + [aknysh_homepage]: https://github.com/aknysh + [aknysh_avatar]: https://img.cloudposse.com/150x150/https://github.com/aknysh.png [![README Footer][readme_footer_img]][readme_footer_link] [![Beacon][beacon]][website] diff --git a/README.yaml b/README.yaml index 6757b0b..a88531b 100644 --- a/README.yaml +++ b/README.yaml @@ -389,3 +389,7 @@ contributors: github: "osterman" - name: "Vladimir" github: "SweetOps" + - name: "RB" + github: "nitrocode" + - name: "Andriy Knysh" + github: "aknysh" diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index cea6751..11a8999 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -47,3 +47,8 @@ output "disabled_sg_name" { description = "The disabled Security Group Name (should be empty)" value = module.disabled_security_group.name == null ? "" : module.disabled_security_group.name } + +output "rules_terraform_ids" { + description = "List of Terraform IDs of created `security_group_rule` resources" + value = module.new_security_group.rules_terraform_ids +} diff --git a/exports/security_group_inputs.tf b/exports/security-group-inputs.tf similarity index 99% rename from exports/security_group_inputs.tf rename to exports/security-group-inputs.tf index 9a2c07b..c23de81 100644 --- a/exports/security_group_inputs.tf +++ b/exports/security-group-inputs.tf @@ -1,6 +1,6 @@ -# security_group_inputs Version: 2 +# security-group-inputs Version: 2 # -# Copy this file from https://github.com/cloudposse/terraform-aws-security-group/blob/master/exports/security_group_inputs.tf +# Copy this file from https://github.com/cloudposse/terraform-aws-security-group/blob/master/exports/security-group-inputs.tf # and EDIT IT TO SUIT YOUR PROJECT. Update the version number above if you update this file from a later version. # Unlike null-label context.tf, this file cannot be automatically updated # because of the tight integration with the module using it. diff --git a/main.tf b/main.tf index 94b2957..495f637 100644 --- a/main.tf +++ b/main.tf @@ -141,17 +141,18 @@ resource "aws_security_group" "cbd" { resource "aws_security_group_rule" "keyed" { for_each = local.keyed_resource_rules - type = each.value.type - from_port = each.value.from_port - to_port = each.value.to_port - protocol = each.value.protocol - description = each.value.description - cidr_blocks = length(each.value.cidr_blocks) == 0 ? null : each.value.cidr_blocks - ipv6_cidr_blocks = length(each.value.ipv6_cidr_blocks) == 0 ? null : each.value.ipv6_cidr_blocks - prefix_list_ids = length(each.value.prefix_list_ids) == 0 ? [] : each.value.prefix_list_ids - self = each.value.self - - security_group_id = local.security_group_id + security_group_id = local.security_group_id + + type = each.value.type + from_port = each.value.from_port + to_port = each.value.to_port + protocol = each.value.protocol + description = each.value.description + + cidr_blocks = length(each.value.cidr_blocks) == 0 ? null : each.value.cidr_blocks + ipv6_cidr_blocks = length(each.value.ipv6_cidr_blocks) == 0 ? null : each.value.ipv6_cidr_blocks + prefix_list_ids = length(each.value.prefix_list_ids) == 0 ? [] : each.value.prefix_list_ids + self = each.value.self source_security_group_id = each.value.source_security_group_id depends_on = [aws_security_group.cbd, aws_security_group.default] diff --git a/normalize.tf b/normalize.tf index 01d6daa..28a4686 100644 --- a/normalize.tf +++ b/normalize.tf @@ -157,5 +157,3 @@ locals { all_resource_rules = concat(local.norm_rules, local.self_rules, local.sg_exploded_rules, local.other_rules, local.extra_rules) keyed_resource_rules = { for r in local.all_resource_rules : r.key => r } } - - diff --git a/outputs.tf b/outputs.tf index f95474d..762f26e 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,4 +1,3 @@ - output "id" { description = "The created or target Security Group ID" value = local.security_group_id