-
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/aws_emrcontainers_virtual_cluster - new resource #20003
r/aws_emrcontainers_virtual_cluster - new resource #20003
Conversation
0c9c551
to
9c885c2
Compare
+1 |
I've tested this live in my own account and it seems to work well. I was able to create a new EKS cluster, create a dedicated namespace, add the appropriate roles, and successfully run a sample job. @thehunt33r One thing that doesn't seem to be documented here are all the getting started steps including creating service accounts, RBAC roles, IAM roles, etc. Is that work you've already done and/or something that should be included in the documentation? |
I was trying to run the acceptance tests as well, but wasn't able to get around the EMRContainers service role already existing without just deleting the
|
Hey @dacort The service linked role is a role you need to create for any new AWS account. Given that I expect acceptance tests to run in an empty account (everything should be destroyed once Terraform is finished running acceptance tests), then it makes sense to create the service linked role as part of the test.
I didn't want to make the documentation too heavy by adding that, but I now realize those are prerequisites to be able to use the resource, so yeah I'll get that added to the documentation! |
Ah ok, that makes sense. Per the docs the role will get created automatically by EMR on EKS, but I don't see any issue with creating it manually. Let me know if there's anything else I can help with. I've been messing around with the ExternalProvider issue as well, but haven't made any progress. |
@thehunt33r I think the problem with the I've tried a number of different things including aliasing the provider, creating two tests where the first builds the infrastructure and the second adds the k8s provider, and a few other things but nothing seemed to work. I also tried looking at the k8s and EKS plugins to see if they used the provider in a similar way, but it doesn't look like they do. :( |
@dacort I see you mentioned you tried using @thehunt33r code in this PR and you got the EMR cluster created on EKS. Are there any steps that you can share with me to get the EMR up in EKS? |
Yes, will try to create a repo tomorrow with example. Most of what you need is defined in the acceptance tests, but you'll need to download this repo, change to this branch, and build the AWS plugin with this change. Then override the AWS provider in your |
@sahotay I added my example here. https://github.com/dacort/emr-eks-terraform It shows:
Let me if you give it a shot and just open an issue on my repo if you run into any issues. |
@thehunt33r I got this working and created the virtual cluster. Thanks, @dacort for your help and for creating the sample module. few things I would like to mention:-
|
@thehunt33r How close is this to the merge ✅ ? |
Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding. Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author. For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000. For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide. |
…tate' attributes.
This comment was marked as outdated.
This comment was marked as outdated.
Happy to help review this if wanted. 😃 |
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.
LGTM 🚀.
% make testacc TESTS=TestAccEMRContainersVirtualCluster PKG=emrcontainers ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/emrcontainers/... -v -count 1 -parallel 1 -run='TestAccEMRContainersVirtualCluster' -timeout 180m
=== RUN TestAccEMRContainersVirtualClusterDataSource_basic
=== PAUSE TestAccEMRContainersVirtualClusterDataSource_basic
=== RUN TestAccEMRContainersVirtualCluster_basic
=== PAUSE TestAccEMRContainersVirtualCluster_basic
=== RUN TestAccEMRContainersVirtualCluster_disappears
=== PAUSE TestAccEMRContainersVirtualCluster_disappears
=== RUN TestAccEMRContainersVirtualCluster_tags
=== PAUSE TestAccEMRContainersVirtualCluster_tags
=== CONT TestAccEMRContainersVirtualClusterDataSource_basic
--- PASS: TestAccEMRContainersVirtualClusterDataSource_basic (1053.96s)
=== CONT TestAccEMRContainersVirtualCluster_disappears
--- PASS: TestAccEMRContainersVirtualCluster_disappears (1172.94s)
=== CONT TestAccEMRContainersVirtualCluster_tags
--- PASS: TestAccEMRContainersVirtualCluster_tags (1144.52s)
=== CONT TestAccEMRContainersVirtualCluster_basic
--- PASS: TestAccEMRContainersVirtualCluster_basic (1028.82s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/emrcontainers 5101.662s
@thehunt33r @shuheiktgw Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.13.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. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This PR continues the work of @shuheiktgw in #17355 by finishing up the acceptance tests and fixing a few odds and ends.
It also adds the data source for
aws_emrcontainers_virtual_cluster
and the documentation for both resource and datasource.Community Note
Closes #16717.
Relates #17355.
Output from acceptance testing:
Observations:
Questions:
I'm currently trying to fix the failure to import the
aws_emrcontainers_virtual_cluster
.In order to create the Kubernetes resources, I am using
ExternalProviders
to initialize and download the Kubernetes provider. According to the comments on ExternalProviders we should not need this since we don't rely on the provider being present to test the import.However when I don't specify ExternalProviders, I get this error
If I specify the ExternalProviders for the
kubernetes
provider, I will not be able to test the import of a clusterI think I am hitting the issue documented here hashicorp/terraform-plugin-sdk#562
I'm not sure what is the best way forward:
I feel either way is pretty suboptimal.
I would appreciate some advice on this problem!