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

Bridgecrew compliance #125

Merged
merged 3 commits into from
Feb 7, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# .tfstate files
*.tfstate
*.tfstate.*
**/.terraform.lock.hcl

# .tfvars files
*.tfvars
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ you can exclude environment and the label `id` will look like `{namespace}-{stag
- If you want the attributes in a different order, you can specify that, too, with the `label_order` list.
- You can set a maximum length for the name, and the module will create a unique name that fits within that length.
- You can control the letter case of the generated labels which make up the `id` using `var.label_value_case`.
- The labels are also exported as tags. You can control the case of the tag names (keys) using `var.label_tag_case`.
- The labels are also exported as tags. You can control the case of the tag names (keys) using `var.label_key_case`.

It's recommended to use one `terraform-null-label` module for every unique resource of a given resource type.
For example, if you have 10 instances, there should be 10 different labels.
Expand Down
2 changes: 1 addition & 1 deletion README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ description: |-
- If you want the attributes in a different order, you can specify that, too, with the `label_order` list.
- You can set a maximum length for the name, and the module will create a unique name that fits within that length.
- You can control the letter case of the generated labels which make up the `id` using `var.label_value_case`.
- The labels are also exported as tags. You can control the case of the tag names (keys) using `var.label_tag_case`.
- The labels are also exported as tags. You can control the case of the tag names (keys) using `var.label_key_case`.

It's recommended to use one `terraform-null-label` module for every unique resource of a given resource type.
For example, if you have 10 instances, there should be 10 different labels.
Expand Down
14 changes: 12 additions & 2 deletions examples/autoscalinggroup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,21 @@ resource "aws_launch_template" "default" {
enabled = false
}

# terraform-null-label example used here: Set tags on volumes
# terraform-null-label example used here: Set tags on everything that can be tagged
tag_specifications {
resource_type = "volume"
for_each = ["instance", "volume", "elastic-gpu", "spot-instance-request"]

resource_type = each.value
tags = module.label.tags
}

# Bridgecrew BC_AWS_GENERAL_26
tags = module.label.tags

# Bridgecrew compliance: Ensure Instance Metadata Service Version 1 is not enabled (BC_AWS_GENERAL_31)
metadata_options {
http_tokens = "required"
}
}

######################
Expand Down