terraform:modules1
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
terraform:modules1 [10/02/2025 17:17] – andrew | terraform:modules1 [12/02/2025 16:29] (current) – andrew | ||
---|---|---|---|
Line 3: | Line 3: | ||
To create an AWS parameter in a module, just the simplest example I could think of. The access key and secret are exported as shell variables. This is not the best way to do this, but the object of the excercise is to play with modules not authentication. | To create an AWS parameter in a module, just the simplest example I could think of. The access key and secret are exported as shell variables. This is not the best way to do this, but the object of the excercise is to play with modules not authentication. | ||
+ | |||
+ | ===== Code ===== | ||
Line 48: | Line 50: | ||
module " | module " | ||
source | source | ||
- | para_name | + | para_name |
- | para_value = " | + | para_value = var.test2 |
} | } | ||
Line 94: | Line 96: | ||
+ | ===== Result ===== | ||
+ | |||
+ | This outputs the arn of the parameter created. | ||
+ | |||
+ | <code bash> | ||
+ | $ terraform apply | ||
+ | |||
+ | Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: | ||
+ | + create | ||
+ | |||
+ | Terraform will perform the following actions: | ||
+ | |||
+ | # module.set_parameter.aws_ssm_parameter.mypara will be created | ||
+ | + resource " | ||
+ | + arn = (known after apply) | ||
+ | + data_type | ||
+ | + id = (known after apply) | ||
+ | + insecure_value = (known after apply) | ||
+ | + key_id | ||
+ | + name = " | ||
+ | + tags_all | ||
+ | + " | ||
+ | } | ||
+ | + tier = (known after apply) | ||
+ | + type = " | ||
+ | + value = (sensitive value) | ||
+ | + version | ||
+ | } | ||
+ | |||
+ | Plan: 1 to add, 0 to change, 0 to destroy. | ||
+ | |||
+ | Changes to Outputs: | ||
+ | + Parameter_Name = (known after apply) | ||
+ | |||
+ | |||
+ | module.set_parameter.aws_ssm_parameter.mypara: | ||
+ | module.set_parameter.aws_ssm_parameter.mypara: | ||
+ | |||
+ | Apply complete! Resources: 1 added, 0 changed, 0 destroyed. | ||
+ | |||
+ | Outputs: | ||
+ | |||
+ | Parameter_Name = " | ||
+ | |||
+ | $ | ||
+ | </ | ||
+ | '' | ||
terraform/modules1.1739207879.txt.gz · Last modified: by andrew