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

Add new service package Support and new resource Case #132

Merged
merged 5 commits into from
Jan 31, 2024

Conversation

mergenci
Copy link
Collaborator

@mergenci mergenci commented Jan 29, 2024

Description

Add new service package Support and new resource Case.

Details

Terraform AWS Provider's Contributor Guide, /docs directory of the repo, documents everything about provider development.

As part of this PR, we first configured our development environment by running make tools and then testing our setup by running make build.

In order to introduce our new service, AWS Support, we followed Adding a New AWS Service section. More specifically, we applied the following steps.

  1. Edit names/names_data.csv. Uncheck NotImplemented column, by removing “x”. Disable AWS SDK Go v1 client, by removing “1”, and enable AWS SDK Go v2 client, by adding “2” to the next column.
  2. Create internal/service/support/generate.go.
  3. Run make gen and go mod tidy.

Above commands generated AWS client (internal/conns/awsclient_gen.go) and configure the service package (internal/provider/service_packages_gen.go).

Finally, we implemented our new resource Case by following Adding a New Resource. Adding a resource requires another make gen that registers the resource to internal/service/support/service_package_gen.go We frequently referred to existing Plugin Framework resource implementations, which could be easily located by searching @FrameworkResource in the repository.

Contributor Guide has a dedicated section for debugging. First, we step-debugged an acceptance test, which creates resources in the cloud. Then, we end-to-end tested using Terraform CLI. In order to do so, we wrote a .terraformrc, to point Terraform to our provider build with a provider installation section.

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @mergenci 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@mergenci mergenci marked this pull request as draft January 29, 2024 14:36
@mergenci mergenci marked this pull request as ready for review January 29, 2024 15:09
Signed-off-by: Cem Mergenci <cmergenci@gmail.com>
@ulucinar
Copy link
Collaborator

Hi @mergenci,
Thank you for introducing the new resource with the Terraform plugin framework. Let's make sure that we also open an upstream PR for this resource.

Could you please document the steps needed to add a new framework resource (including the generator commands). It would be helpful as a reference.

Copy link
Collaborator

@ulucinar ulucinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mergenci for working on the new SupportCase resource. Left some minor comments. Let's discuss.

go.mod Show resolved Hide resolved
internal/service/support/support_case.go Outdated Show resolved Hide resolved
internal/service/support/support_case.go Outdated Show resolved Hide resolved
internal/service/support/support_case.go Outdated Show resolved Hide resolved
internal/service/support/support_case.go Outdated Show resolved Hide resolved
internal/service/support/support_case.go Outdated Show resolved Hide resolved
internal/service/support/support_case.go Outdated Show resolved Hide resolved
internal/service/support/support_case.go Outdated Show resolved Hide resolved
internal/service/support/support_case.go Outdated Show resolved Hide resolved
internal/service/support/support_case_test.go Outdated Show resolved Hide resolved
AWS Support SDK documentation states that ten CC email addresses are
allowed, but eleven email addresses are accepted in practice.

https://docs.aws.amazon.com/awssupport/latest/APIReference/API_CreateCase.html

Signed-off-by: Cem Mergenci <cmergenci@gmail.com>
Signed-off-by: Cem Mergenci <cmergenci@gmail.com>
According to resource naming rules in Contributor Guide, "Case" is a
better name than "SuportCase".

https://hashicorp.github.io/terraform-provider-aws/naming/#rule_2

Signed-off-by: Cem Mergenci <cmergenci@gmail.com>
Signed-off-by: Cem Mergenci <cmergenci@gmail.com>
Copy link
Collaborator

@ulucinar ulucinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mergenci, lgtm. Thank you for implementing the new resource with the Terraform plugin framework.

@mergenci mergenci changed the title Add new service package Support and new resource SupportCase Add new service package Support and new resource Case Jan 31, 2024
@ulucinar ulucinar merged commit 4708239 into upbound:upjet-v5.31.0 Jan 31, 2024
27 of 43 checks passed
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants