-
-
Save jufemaiz/96d8ab9b7ab7d0988c2a30b17a66c872 to your computer and use it in GitHub Desktop.
Terraform aws_ssm_parameter issues
This file contains 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 plan | |
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" { | |
│ | |
╵ |
This file contains 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 { | |
backend "local" { | |
path = "main.tfstate" | |
} | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 5.2" | |
} | |
} | |
} | |
provider "aws" { | |
region = "ap-southeast-2" | |
} | |
module "data_aws_ssm_parameter_path_to_a_parameter" { | |
source = "./module/" # Note: this is here as 'module-main.tf' due to gist issues. | |
path_to_a_parameter_ssm_parameter_name = aws_ssm_parameter.path_to_a_parameter.name | |
} | |
data "aws_ssm_parameter" "path_to_a_parameter" { | |
name = aws_ssm_parameter.path_to_a_parameter.name | |
} | |
resource "aws_ssm_parameter" "path_to_a_parameter" { | |
name = "/path/to/a/parameter" | |
value = "A value" | |
} | |
output "path_to_a_parameter_ssm_parameter_name" { | |
value = aws_ssm_parameter.path_to_a_parameter.name | |
} |
This file contains 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 "aws_ssm_parameter" "path_to_a_parameter" { | |
name = var.path_to_a_parameter_ssm_parameter_name | |
} | |
variable "path_to_a_parameter_ssm_parameter_name" { | |
type = string | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment