Skip to content

Conversation

parisholley
Copy link

I ran into this issue when trying to create a lex bot: #619

Looking through the issue log, I suspect there are a lot of open issues that have the same problem:

My solution addresses two things:

  1. WriteOnly fields should not be marked as "compute: true", otherwise TF will attempt to compare the CloudControl response (which doesn't have the property) to the DesiredState
  2. WriteOnly (and other flags) need to cascade down to child properties, in my case, bot_locale was compute = false, but because some of the properties beneath were marked as compute = true, the error still exists

For anyone wanting to try this, I have published my fork with this fix:

https://registry.terraform.io/providers/parisholley/awscc/latest

As a note, I am curious if this fix maybe negates the need for this previous PR:

#1737

@parisholley parisholley requested a review from a team as a code owner October 11, 2024 00:47
@parisholley
Copy link
Author

here are the two changes given that most of the touched files are from make resources

createOnly := false
readOnly := false
writeOnly := false
var chunks [][]string
// Build combinations
for i := 1; i <= len(path); i++ {
combination := path[:i]
chunks = append(chunks, combination)
}
for i := 0; i < len(chunks); i++ {
if e.CfResource.CreateOnlyProperties.ContainsPath(chunks[i]) {
createOnly = true
}
if e.CfResource.ReadOnlyProperties.ContainsPath(chunks[i]) {
readOnly = true
}
if e.CfResource.WriteOnlyProperties.ContainsPath(chunks[i]) {
writeOnly = true
}
}

if optional && !computed && !writeOnly {
computed = true
}

@ewbankkit ewbankkit added the code-generation Relates to the conversion of CloudFormation schema to Terraform schema at buildtime. label Oct 17, 2024
@Krata4
Copy link

Krata4 commented Mar 13, 2025

Hello, are you planning to do marge please?

@sgalloway-earnest
Copy link

Hi, I encountered this issue with "awscc_cognito_managed_login_branding", the provider fails at apply for any changes, because it is trying to provide the client_id which is a write-only computed property.

@parisholley is the PR still active?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-generation Relates to the conversion of CloudFormation schema to Terraform schema at buildtime. needs-triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants