Open obiSerra opened 4 months ago
I noticed on the debug log, AWSCC provider received the GetResponse from CCAPI after CreateResource: https://gist.github.com/obiSerra/2e00c9a2399fdc00c75ba712df2781c2#file-terraform-apply-txt-L433-L436
Diving deeper to the response body:
{
"ResourceDescription": {
"Identifier": "3ab52525-8625-447a-8513-7fc6d3aa75a4",
"Properties": "{\"Components\":{\"aws.greengrass.SystemsManagerAgent\":{\"ComponentVersion\":\"1.2.4\"},\"aws.greengrass.LogManager\":{\"ComponentVersion\":\"2.3.7\"},\"aws.greengrass.Nucleus\":{\"ComponentVersion\":\"2.12.4\"}},\"DeploymentName\":\"setup-deployment\",\"DeploymentId\":\"3ab52525-8625-447a-8513-7fc6d3aa75a4\",\"TargetArn\":\"arn:aws:iot:eu-west-1:767397968620:thinggroup/test-device-group\",\"Tags\":{}}"
},
"TypeName": "AWS::GreengrassV2::Deployment"
}
and then decoding the Properties
value:
{
"Components": {
"aws.greengrass.SystemsManagerAgent": {
"ComponentVersion": "1.2.4"
},
"aws.greengrass.LogManager": {
"ComponentVersion": "2.3.7"
},
"aws.greengrass.Nucleus": {
"ComponentVersion": "2.12.4"
}
},
"DeploymentName": "setup-deployment",
"DeploymentId": "3ab52525-8625-447a-8513-7fc6d3aa75a4",
"TargetArn": "arn:aws:iot:eu-west-1: 767397968620:thinggroup/test-device-group",
"Tags": {}
}
I noticed that the Components
attributes value are incomplete compared to what is declared in HCL.
I think this is an upstream issue, GetResource should return the full ComponentDeploymentSpecification including the ComponentVersion
, ConfigurationUpdate
, and RunWith
.
Thanks for reporting this issue, I have escalated this to the service team at AWS.
thank for your quick answer
@wellsiau-aws @obiSerra The configuration_update has merge and reset capitalized in the example above.
resource "awscc_greengrassv2_deployment" "setup_deployment" {
deployment_name = "setup-deployment"
target_arn = awscc_iot_thing.example.arn
deployment_policies = {
configuration_validation_policy = {
timeout_in_seconds = 60
}
component_update_policy = {
timeout_in_seconds = 55
}
failure_handling_policy = "ROLLBACK"
}
components = {
"aws.greengrass.Nucleus" = {
component_version = "2.12.4"
configuration_update = {
reset = [""]
merge = jsonencode(
{
"spooler" : {
"storageType" : "Disk"
"maxSizeInBytes" : "2048"
}
}
)
}
},
"aws.greengrass.Cli" = {
component_version = "2.12.5"
},
"aws.greengrass.LogManager" = {
component_version = "2.3.7"
configuration_update = {
reset = [""]
merge = jsonencode(
{
"logsUploaderConfiguration" : {
"systemLogsConfiguration" : {
"uploadToCloudWatch" : "true",
"minimumLogLevel" : "INFO",
"diskSpaceLimit" : "10",
"diskSpaceLimitUnit" : "MB",
"deleteLogFileAfterCloudUpload" : "false"
},
"componentLogsConfigurationMap" : {
"aws.greengrass.SystemsManagerAgent" : {
"minimumLogLevel" : "INFO",
"diskSpaceLimit" : "20",
"diskSpaceLimitUnit" : "MB",
"deleteLogFileAfterCloudUpload" : "false"
}
}
},
"periodicUploadIntervalSec" : "300",
"deprecatedVersionSupport" : "false"
}
)
}
}
}
}
@obiSerra Can you try the config with the lower case input params ?
Community Note
Terraform CLI and Terraform AWS Cloud Control Provider Version
Terraform v1.8.2
provider registry.terraform.io/hashicorp/awscc v0.76.0
Affected Resource(s)
awscc_greengrassv2_deployment
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Full debug output https://gist.github.com/obiSerra/2e00c9a2399fdc00c75ba712df2781c2
Expected Behavior
The components configuration should be the one defined inside the
components.configuration_update
.Actual Behavior
The components configuration is always empty:
Steps to Reproduce
awscc_greengrassv2_deployment
with any module that accepts a configuration (see above)terraform plan
terraform apply
Important Factoids
While debugging I noticed that
terraform
generate this warning both during plan and during apply: