Welly Siauw AWS
Welly Siauw AWS
We know that `description` is not a force-replacement attributes ``` "createOnlyProperties": [ "/properties/ApplyCapacity", "/properties/BuildId", "/properties/CertificateConfiguration", "/properties/EC2InstanceType", "/properties/FleetType", "/properties/InstanceRoleARN", "/properties/InstanceRoleCredentialsProvider", "/properties/LogPaths", "/properties/PeerVpcAwsAccountId", "/properties/PeerVpcId", "/properties/ScriptId", "/properties/ServerLaunchParameters", "/properties/ServerLaunchPath", "/properties/CertificateType", "/properties/ComputeType" ], ```
relates to #1139
upstream issue, I can replicate this via CCAPI ``` aws cloudcontrol create-resource --type-name AWS::Events::Rule --desired-state file://state.json { "ProgressEvent": { "TypeName": "AWS::Events::Rule", "RequestToken": "f2a19968-fc64-4649-8409-49bd90c812e3", "Operation": "CREATE", "OperationStatus": "IN_PROGRESS", "EventTime": "2023-12-21T13:03:53.217000-08:00" }...
TF DEBUG output shows that the only detected changes are for `tf_attribute_path=description`: ``` @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/awscc tf_req_id=b0f34296-ded1-42e8-f685-f95bca6fe3de tf_resource_type=awscc_ec2_ipam_pool tf_attribute_path=description tf_rpc=PlanResourceChange timestamp=2023-09-11T16:46:38.496-0700 ```
IPAM Pool create only properties ``` "createOnlyProperties": [ "/properties/IpamScopeId", "/properties/SourceIpamPoolId", "/properties/Locale", "/properties/AddressFamily", "/properties/PubliclyAdvertisable", "/properties/PublicIpSource", "/properties/AwsService", "/properties/SourceResource" ], ```
Terraform plan shows force replacement for these createOnlyProperties: ``` # awscc_ec2_ipam_pool.example must be replaced -/+ resource "awscc_ec2_ipam_pool" "example" { + allocation_default_netmask_length = (known after apply) + allocation_max_netmask_length = (known after...
These attributes are stored as null in the Terraform state file ``` { "mode": "managed", "type": "awscc_ec2_ipam_pool", "name": "example", "provider": "provider[\"registry.terraform.io/hashicorp/awscc\"]", "instances": [ { "schema_version": 1, "attributes": { "address_family": "ipv4",...
GetResource using CCAPI confirms that these attributes are not included in the response: - aws_service - public_ip_source - publicly_advertisable - source_ipam_pool_id - source_resource See below for the output: ``` aws...
I suspect the [plan modifiers](https://github.com/hashicorp/terraform-provider-awscc/blob/main/internal/aws/ec2/ipam_pool_resource_gen.go#L200-L202) couldn't distinguish `null` value in Terraform state file versus no attributes on CCAPI GetResource response.
@ewbankkit , with the lack of default values available on the schema, does this mean we need a custom plan modifiers?