This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| locals { | |
| iam_access_creds = ( | |
| var.create ? | |
| var.create_livewire_accesser ? | |
| [module.iam[0].access_key_id, module.iam[0].access_key_secret, module.iam-restriction[0].access_key_id, module.iam-restriction[0].access_key_secret] : | |
| [module.iam[0].access_key_id, module.iam[0].access_key_secret] : | |
| [] | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data "template_file" "codebuild" { | |
| template = file("${path.module}/policies/role-policy.json") | |
| vars = { | |
| aws_s3_bucket_arn = module.aws_s3_bucket.arn[0] | |
| } | |
| } | |
| role-policy.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_network_interface" "subnets" { | |
| for_each = { for subnet in module.vpc.public_subnets : subnet.id => subnet } | |
| subnet_id = each.value.key | |
| } | |
| // reference: https://selleo.com/til/posts/cnfrqv1ipl-foreach-over-tuples-in-terraform |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # object | |
| output "repo_ids" { | |
| value = { | |
| for idx,repo in aws_ecr_repository.repo : idx => repo.registry_id | |
| } | |
| } | |
| # list | |
| output elastic_ips { | |
| value = [for eip in aws_eip.eip : eip.id] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TF_LOG=TRACE terraform foo | |
| https://www.terraform.io/internals/debugging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Version 11 | |
| count = "${var.create_bucket == true ? 1 : 0}" | |
| > version 12 | |
| count = var.db_username != "" ? 1 : 0 | |
| Version 13 | |
| count = var.create_bucket ? 1 : 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| terraform import -var-file="../prod.tfvars" 'module.ip-address.azurerm_public_ip.static_ip' /subscriptions/6ba1-4e5d-a23e-0e4d3a59208d/resourceGroups/MC_h-network-resources_h-cluster_northeurope/providers/Microsoft.Network/publicIPAddresses/h-ip | |
| terraform import -var-file="../prod.tfvars" 'module.key-vault.azurerm_key_vault.main' /subscriptions/6ba1-4e5d-a23e-0e4d3a59208d/resourceGroups/h-resources/providers/Microsoft.KeyVault/vaults/h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /github subscribe MyCorp/infrastructure comments reviews |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat customers/develop.json | jq '. [] | select(.creates_infrastructure_foundation == true)' | jq 'if .run_edge then 1 else 0 end' | |
| Source: https://www.garysieling.com/blog/jq-boolean-integer/ |