Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure updating AppSync Schema still updates the terraform state for it #20055

Open
ddanila opened this issue Jul 2, 2021 · 4 comments
Open
Labels
bug Addresses a defect in current functionality. service/appsync Issues and PRs that pertain to the appsync service. upstream Addresses functionality related to the cloud provider.

Comments

@ddanila
Copy link

ddanila commented Jul 2, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.15.4
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.47.0

(Terraform is not the latest one, but as I can understand the issue is most likely is in the provider, which is the latest one).

Affected Resource(s)

  • aws_appsync_graphql_api

Terraform Configuration Files

resource "aws_appsync_graphql_api" "danila_graphql_api" {
  authentication_type = "API_KEY"
  name                = "danila-api-v1"

  schema = <<SCHEMA

type Window {
  title: String
  image: String
  style: String
  index: Int
}

schema {
  query: Query
}

  SCHEMA
}

Debug Output

https://gist.github.com/ddanila/7ea7f755cb57cf96abca28b1dcdd90ce

Expected Behavior

Schema is updated successfully. Terraform State is in sync with the remote state in AWS.

Actual Behavior

Schema failed to update successfully.
Terraform State contains the updated schema.
AWS still has the previous version of the schema.

Steps to Reproduce

Note: unfortunately, it's not that easy to reproduce the issue. For some unknown reason AWS returned failure on the schema update (was adding "index: Int" field).

  1. Change the schema (add or remove some field).
  2. terraform plan -out=plan
  3. terraform apply "plan"

Note that trying to apply the changes again lead to No changes. Infrastructure is up-to-date. message.

Same for the refresh attempt for the obvious reason:


aws_appsync_graphql_api.danila_graphql_api: Refreshing state... [id=2suu7272ofgfranvj5ax3f53ve]
No changes. Your infrastructure still matches the configuration.
Terraform has checked that the real remote objects still match the result of your most recent changes, and found no differences.

(this statement is not true, infra does not match the state, but this is expected due to #11460)

References

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/appsync Issues and PRs that pertain to the appsync service. labels Jul 2, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. upstream Addresses functionality related to the cloud provider. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 2, 2021
@ewbankkit
Copy link
Contributor

@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jun 22, 2023
@BroMattMiller
Copy link

I got this behavior when I had a syntax error in my schema. AWS errors out, the error message returned by terraform doesn't indicate the problem, but then the tf state file incorrectly shows the schema was updated. My workaround was to remove the schema from the terraform resource, and that was accepted. At that point AWS and the tf state were in sync, both showing an api with no schema. Then I validated my schema syntax in the AWS AppSync console schema editor to see what my error was, but I didn't save the schema there. Then I updated the schema in my terraform resource with the correct syntax, and it was all good.

@github-actions github-actions bot removed the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jul 12, 2023
@riccalioliojr
Copy link

This still happens when using:

Terraform v1.5.4
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v5.9.0

I hope this gets fixed soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/appsync Issues and PRs that pertain to the appsync service. upstream Addresses functionality related to the cloud provider.
Projects
None yet
Development

No branches or pull requests

4 participants