-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Incompatible with stepfunctions-local / localstack #8450
Comments
…r for ListTagsForResource Reference: #8450 Verified against LocalStack: ``` aws_sfn_state_machine.state_machine: Creating... creation_date: "" => "<computed>" definition: "" => "{\n \"StartAt\": \"finish\",\n \"States\": {\n \"finish\": {\n \"Type\": \"Succeed\"\n }\n }\n}\n" name: "" => "machine" role_arn: "" => "arn:aws:iam::123123123123:role/some_role" status: "" => "<computed>" aws_sfn_state_machine.state_machine: Creation complete after 0s (ID: arn:aws:states:us-east-1:000000000000:stateMachine:machine) Apply complete! Resources: 1 added, 0 changed, 0 destroyed. ``` Output from acceptance testing (eventual consistency error is also present on master): ``` --- FAIL: TestAccAWSSfnStateMachine_createUpdate (38.23s) testing.go:568: Step 1 error: Check failed: Check 5/6 error: aws_sfn_state_machine.foo: Attribute 'definition' didn't match ".*\\\"MaxAttempts\\\": 10.*", got "{\n \"Comment\": \"A Hello World example of the Amazon States Language using an AWS Lambda Function\",\n \"StartAt\": \"HelloWorld\",\n \"States\": {\n \"HelloWorld\": {\n \"Type\": \"Task\",\n \"Resource\": \"arn:aws:lambda:us-west-2:187416307283:function:sfn-weedqxml47\",\n \"Retry\": [\n {\n \"ErrorEquals\": [\"States.ALL\"],\n \"IntervalSeconds\": 5,\n \"MaxAttempts\": 5,\n \"BackoffRate\": 8.0\n }\n ],\n \"End\": true\n }\n }\n}\n" --- PASS: TestAccAWSSfnStateMachine_Tags (53.08s) ```
Hi @atbentley 👋 Thanks for reporting this and sorry for the trouble here. While we support customization of service endpoints in the Terraform AWS Provider, their usage is only regularly integration tested against standard AWS environments (e.g. AWS Standard and AWS GovCloud (US)) and support outside those is best effort at the current time. The Custom Service Endpoints Configuration Guide currently has the following note to try and relay this information:
If we can improve the above documentation on this manner, please do let us know. That said, we do want to improve our compatibility with LocalStack and this seems like it should be fairly straightforward to fix the support in the I have submitted this fix, which I verified against LocalStack using the configuration provided above: #8467 There are some complexities to enable LocalStack with our current acceptance testing framework which generally uses environment variables, however there is no such environment variables for endpoint configurations. We would prefer AWS introduced a standard configuration method (environment variable convention, AWS configuration file, etc.) for customizing multiple endpoints instead of implementing our own system if possible. Hopefully this situation will improve over time and we will think about other ways we can achieve LocalStack testing. If you do find other cases where the Terraform AWS Provider is not able to work correctly with LocalStack, please feel free to submit additional issues. Thanks again. |
Hey @bflad, I totally get and respect the product not wanting to support multiple targets other than AWS. I also think the documentation is totally clear here. I just wanted to point out that the sfn endpoint configuration change and the sfn tag change seem to conflict with eachother in that one was done to allow localstack and the other had broken that support. In any case, I'm thankful for you submitting a fix for this :) |
The change to bypass the |
Hi all, Thank you @bflad. Using that recent released Version I came up with this: Here I have my repo wich ends throwing that error. To saw it, you need to add DEBUG=1 before start Localstack. Localstack on debug mode Throws me:
|
Hi @alejandrocena 👋 While we cannot debug your LocalStack environment, the logging output you show appears to be the desired behavior with the Terraform resource, even on version 2.9.0 of the Terraform AWS Provider. Terraform will always attempt to make the |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/atbentley/ca44043bb0abf55b913aaad0205f381d
Expected Behavior
Terraform should successfully create a state machine in stepfunctions-local / localstack, and then successfully exit.
It is expected to work since the endpoint configuration for stepfunctions exists to interact with localstack / etc.
Actual Behavior
Terraform successfully creates the statemachine, then after creation requests the tags for the state machine and then fails since stepfunctions-local does not implement the list-tags-for-resource endpoint of stepfunctions.
Steps to Reproduce
SERVICES=lambda,stepfunctions localstack start --docker
terraform init
terraform apply
aws stepfunctions --region eu-central-1 --endpoint http://localhost:4585 list-state-machines
Important Factoids
References
This issue introduces the
stepfunctions
endpoint configuration so that terraform can be used with stepfunctions-local or localstack: #7735This issue introduces support for resource tags on state machines: #6971
localstack (wraps stepfunctions-local): https://github.com/localstack/localstack
stepfunctions-local: https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local.html
The text was updated successfully, but these errors were encountered: