The module's data aws_ssm_parameter should not attempt to discover the resource while it has not been created in main.tf.
Actual Behavior
Error is thrown:
$ terraform apply
module.data_aws_ssm_parameter_path_to_a_parameter.data.aws_ssm_parameter.path_to_a_parameter: Reading...
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
<= read (data resources)
Terraform planned the following actions, but then encountered a problem:
# data.aws_ssm_parameter.path_to_a_parameter will be read during apply
# (depends on a resource or a module with changes pending)
<= data "aws_ssm_parameter" "path_to_a_parameter" {
+ arn = (known after apply)
+ id = (known after apply)
+ insecure_value = (known after apply)
+ name = "/path/to/a/parameter"
+ type = (known after apply)
+ value = (sensitive value)
+ version = (known after apply)
}
# aws_ssm_parameter.path_to_a_parameter will be created
+ resource "aws_ssm_parameter" "path_to_a_parameter" {
+ arn = (known after apply)
+ data_type = (known after apply)
+ id = (known after apply)
+ insecure_value = (known after apply)
+ key_id = (known after apply)
+ name = "/path/to/a/parameter"
+ tags_all = (known after apply)
+ tier = (known after apply)
+ type = "String"
+ value = (sensitive value)
+ version = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ path_to_a_parameter_ssm_parameter_name = "/path/to/a/parameter"
╷
│ Error: reading SSM Parameter (/path/to/a/parameter): couldn't find resource
│
│ with module.data_aws_ssm_parameter_path_to_a_parameter.data.aws_ssm_parameter.path_to_a_parameter,
│ on module/main.tf line 1, in data "aws_ssm_parameter" "path_to_a_parameter":
│ 1: data "aws_ssm_parameter" "path_to_a_parameter" {
│
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.9.7
AWS Provider Version
5.70.0
Affected Resource(s)
aws_ssm_parameter
Expected Behavior
https://gist.github.com/jufemaiz/96d8ab9b7ab7d0988c2a30b17a66c872
The module's data
aws_ssm_parameter
should not attempt to discover the resource while it has not been created inmain.tf
.Actual Behavior
Error is thrown:
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
https://gist.github.com/jufemaiz/96d8ab9b7ab7d0988c2a30b17a66c872
Steps to Reproduce
terraform plan
Debug Output
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None