-
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
r/mwaa_environment - new resource #16616
r/mwaa_environment - new resource #16616
Conversation
Hello @shuheiktgw , What is already done:
Just message me, when you have questions about the structure and code. This is my first terraform provider extension of mine, so feedback is appreciated :-) |
Thank you for your help, @CapChrisCap! 👍 This will speed up the process a lot. I'll definitely pick up the parts I haven't completed from your PR. I'll squash the commits after I complete the initial implementation, so I'll name you as a co-author of those squashed commits if you are fine with it! |
I've been struggling with the creation_failure with an ACC test... I'm still actively debugging it so give me a little bit more time 🙇 |
@shuheiktgw I can understand your pain :-D I had the same issue. This is normally because the Subnets do not have any internet connection or are not private subnets: https://docs.aws.amazon.com/mwaa/latest/userguide/vpc-create.html and https://docs.aws.amazon.com/mwaa/latest/userguide/troubleshooting.html#env-create-fail. This was the reason, I created it with the CloudFormation template provided by AWS. The best is probably to use this first and then rewrite this into terraform. Notify me, when I can support ;-) |
The last challenge I have is when I run
|
Co-authored-by: Christoph Caprano <Christoph.Caprano@valiton.com>
Co-authored-by: Christoph Caprano <Christoph.Caprano@valiton.com>
Co-authored-by: Christoph Caprano <Christoph.Caprano@valiton.com>
47d851f
to
60ca28b
Compare
Co-authored-by: Christoph Caprano <Christoph.Caprano@valiton.com>
@CapChrisCap Thank you so much for your support! It's all set so I'll turn this draft into a PR! 🎉 🎉 |
Can somebody please merge this pull request? We are waiting for this feature to be available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Thank you for the great work! We would also appreciate the merge as we are also waiting for this service |
Hi Folks...I'm the PM from the MWAA team. Please let me know if you need any help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shuheiktgw 👋 Thank you so much for your work on this so far. Please see the below initial feedback/questions and let us know if you need help with anything.
Please also note that the acceptance testing in failing for me with errors like the following:
=== CONT TestAccAWSMwaaEnvironment_basic
resource_aws_mwaa_environment_test.go:57: Step 1/2 error: Error running apply: exit status 1
Error: error creating MWAA Environment: ValidationException: Unable to check PublicAccessBlock configuration for the bucket tf-acc-test-4357126281653006425: The public access block configuration was not found (Service: S3, Status Code: 404, Request ID: 3AZ2R85VD2QNN0AV, Extended Request ID: bN/6jbXNsTVlJhteK3VjuUHjUaSbNdEEWmnRAwmNd45Y2nEPYYe8C17+VxjxWWD0kgJ9GBu3ebo=)
It appears that Step 5 of https://docs.aws.amazon.com/mwaa/latest/userguide/mwaa-s3-bucket.html is now being enforced during MWAA Environment creation, which likely means that we need to also include a aws_s3_bucket_public_access_block
resource in the base test configuration such as:
resource "aws_s3_bucket_public_access_block" "test" {
bucket = aws_s3_bucket.test.bucket
block_public_acls = true
block_public_policy = true
}
// Amount of delay to check an environment status | ||
EnvironmentCreatedDelay = 1 * time.Minute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question: Is it possible to forego this mandatory 1 minute delay on creation? The waiter will automatically handle a nil
response from the refresh function as a retryable condition. 👍
// Amount of delay to check an environment status | ||
EnvironmentUpdatedDelay = 1 * time.Minute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question: Can we lower this mandatory 1 minute delay to 15 seconds (or remove it altogether)?
// Amount of delay to check an environment status | ||
EnvironmentDeletedDelay = 1 * time.Minute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question here. 👍
|
||
### Basic Usage | ||
|
||
```hcl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newer documentation linting will flag this:
```hcl | |
```terraform |
|
||
### Example with Airflow configuration options | ||
|
||
```hcl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```hcl | |
```terraform |
|
||
depends_on = [aws_s3_bucket.test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depends_on = [aws_s3_bucket.test] |
|
||
depends_on = [aws_s3_bucket.test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depends_on = [aws_s3_bucket.test] |
"airflow.amazonaws.com", | ||
"airflow-env.amazonaws.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"airflow.amazonaws.com", | |
"airflow-env.amazonaws.com" | |
"airflow.${data.aws_partition.current.dns_suffix}", | |
"airflow-env.${data.aws_partition.current.dns_suffix}" |
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "logs.${data.aws_region.current.name}.amazonaws.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Service": "logs.${data.aws_region.current.name}.amazonaws.com" | |
"Service": "logs.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" |
4ccd079
to
43ab58a
Compare
…to add_resource_aws_mwaa_environment
@bflad Thank you for your review! I confirmed all the ACC tests pass now so I believe I fixed it up. Would you review the PR again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you, @shuheiktgw 🚀
Output from acceptance testing:
--- PASS: TestAccAWSMwaaEnvironment_full (1714.15s)
--- PASS: TestAccAWSMwaaEnvironment_basic (1957.20s)
--- PASS: TestAccAWSMwaaEnvironment_disappears (2239.96s)
--- PASS: TestAccAWSMwaaEnvironment_LogConfiguration (2531.17s)
--- PASS: TestAccAWSMwaaEnvironment_AirflowConfigurationOptions (3225.28s)
Thank you all for your help! @CapChrisCap @ewbankkit @bflad |
This has been released in version 3.36.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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
Relates #16432
Release note for CHANGELOG:
Output from acceptance testing: