Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use_name_prefix override in submodules #95

Merged
merged 1 commit into from Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
@@ -1,10 +1,10 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.7.3
rev: v1.8.1
hooks:
- id: terraform_fmt
- id: terraform_docs
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v1.3.0
rev: v2.1.0
hooks:
- id: check-merge-conflict
92 changes: 46 additions & 46 deletions README.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/complete/README.md
Expand Up @@ -21,10 +21,10 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Description |
|------|-------------|
| this_security_group_description | The description of the security group |
| this_security_group_id | The ID of the security group |
| this_security_group_name | The name of the security group |
| this_security_group_owner_id | The owner ID |
| this_security_group_vpc_id | The VPC ID |
| this\_security\_group\_description | The description of the security group |
| this\_security\_group\_id | The ID of the security group |
| this\_security\_group\_name | The name of the security group |
| this\_security\_group\_owner\_id | The owner ID |
| this\_security\_group\_vpc\_id | The VPC ID |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
10 changes: 5 additions & 5 deletions examples/computed/README.md
Expand Up @@ -19,10 +19,10 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Description |
|------|-------------|
| this_security_group_description | The description of the security group |
| this_security_group_id | The ID of the security group |
| this_security_group_name | The name of the security group |
| this_security_group_owner_id | The owner ID |
| this_security_group_vpc_id | The VPC ID |
| this\_security\_group\_description | The description of the security group |
| this\_security\_group\_id | The ID of the security group |
| this\_security\_group\_name | The name of the security group |
| this\_security\_group\_owner\_id | The owner ID |
| this\_security\_group\_vpc\_id | The VPC ID |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2 changes: 1 addition & 1 deletion examples/disabled/README.md
Expand Up @@ -21,6 +21,6 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Description |
|------|-------------|
| this_security_group_id | The ID of the security group |
| this\_security\_group\_id | The ID of the security group |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
10 changes: 5 additions & 5 deletions examples/dynamic/README.md
Expand Up @@ -21,10 +21,10 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Description |
|------|-------------|
| this_security_group_description | The description of the security group |
| this_security_group_id | The ID of the security group |
| this_security_group_name | The name of the security group |
| this_security_group_owner_id | The owner ID |
| this_security_group_vpc_id | The VPC ID |
| this\_security\_group\_description | The description of the security group |
| this\_security\_group\_id | The ID of the security group |
| this\_security\_group\_name | The name of the security group |
| this\_security\_group\_owner\_id | The owner ID |
| this\_security\_group\_vpc\_id | The VPC ID |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
10 changes: 5 additions & 5 deletions examples/http/README.md
Expand Up @@ -21,10 +21,10 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Description |
|------|-------------|
| this_security_group_description | The description of the security group |
| this_security_group_id | The ID of the security group |
| this_security_group_name | The name of the security group |
| this_security_group_owner_id | The owner ID |
| this_security_group_vpc_id | The VPC ID |
| this\_security\_group\_description | The description of the security group |
| this\_security\_group\_id | The ID of the security group |
| this\_security\_group\_name | The name of the security group |
| this\_security\_group\_owner\_id | The owner ID |
| this\_security\_group\_vpc\_id | The VPC ID |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4 changes: 3 additions & 1 deletion examples/http/main.tf
Expand Up @@ -37,7 +37,9 @@ module "http_sg" {
module "http_mysql_1_sg" {
source = "../../modules/http-80"

name = "http-mysql-1"
name = "http-mysql-1"
use_name_prefix = false

description = "Security group with HTTP and MySQL ports open for everybody (IPv4 CIDR)"
vpc_id = "${data.aws_vpc.default.id}"

Expand Down
11 changes: 6 additions & 5 deletions modules/_templates/main.tf
@@ -1,11 +1,12 @@
module "sg" {
source = "../../"

create = "${var.create}"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
create = "${var.create}"
name = "${var.name}"
use_name_prefix = "${var.use_name_prefix}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"

##########
# Ingress
Expand Down
5 changes: 5 additions & 0 deletions modules/_templates/variables.tf
Expand Up @@ -14,6 +14,11 @@ variable "name" {
description = "Name of security group"
}

variable "use_name_prefix" {
description = "Whether to use name_prefix or fixed name. Should be true to able to update security group name after initial creation"
default = true
}

variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
Expand Down