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 aws_appfabric_ingestion resource #37291

Merged
merged 24 commits into from
Jun 24, 2024

Conversation

davelemons
Copy link
Contributor

@davelemons davelemons commented May 6, 2024

Description

This PR adds a resource for aws_appfabric_ingestion

Relations

Relates #34549.
Requires #37542.
Requires #37468.
Requires #38084.

References

AppFabric Ingestion Docs

Output from Acceptance Testing

% make testacc TESTS=TestAccAppFabricIngestion PKG=appfabric      
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/appfabric/... -v -count 1 -parallel 20 -run='TestAccAppFabricIngestion'  -timeout 360m
=== RUN   TestAccAppFabricIngestion_basic
=== PAUSE TestAccAppFabricIngestion_basic
=== RUN   TestAccAppFabricIngestion_disappears
=== PAUSE TestAccAppFabricIngestion_disappears
=== CONT  TestAccAppFabricIngestion_basic
=== CONT  TestAccAppFabricIngestion_disappears
--- PASS: TestAccAppFabricIngestion_disappears (17.49s)
--- PASS: TestAccAppFabricIngestion_basic (18.88s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/appfabric  30.538s

Copy link

github-actions bot commented May 6, 2024

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.

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. tags Pertains to resource tagging. generators Relates to code generators. service/appfabric Issues and PRs that pertain to the appfabric service. labels May 6, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 6, 2024
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 @davelemons 👋

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! 😃

@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels May 6, 2024
@breathingdust breathingdust added the partner Contribution from a partner. label May 8, 2024
Copy link
Contributor

@meetreks meetreks left a comment

Choose a reason for hiding this comment

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

Good code, excellent start. Couple of minor things

  1. Update Function
  2. Tests -- hard coding needs to be removed and more tests need to be added.
  3. change log file is required.

internal/service/appfabric/ingestion.go Outdated Show resolved Hide resolved
internal/service/appfabric/ingestion.go Outdated Show resolved Hide resolved
internal/service/appfabric/ingestion.go Outdated Show resolved Hide resolved
internal/service/appfabric/ingestion.go Outdated Show resolved Hide resolved
internal/service/appfabric/ingestion.go Outdated Show resolved Hide resolved
internal/service/appfabric/ingestion.go Outdated Show resolved Hide resolved
internal/service/appfabric/ingestion.go Outdated Show resolved Hide resolved
internal/service/appfabric/ingestion_test.go Outdated Show resolved Hide resolved
internal/service/appfabric/ingestion_test.go Show resolved Hide resolved
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

@davelemons
Copy link
Contributor Author

I believe I have all of the items addressed. There is no update API, so I changed it to a no-op, let me know if there is anything else I should do there. It's a pretty simple service and I'm struggling to think of other tests to add at this point and open to some suggestions/pointers of additional tests to add. Also, I'm not sure why it's seeing GO V1 usage...I should be using V2 for everything.

Copy link
Contributor

@meetreks meetreks left a comment

Choose a reason for hiding this comment

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

The Code is good to go. some minor edit

  1. html pages -- refer to AWS documentation for list of values
  2. Import statements needs tidy up - refer to other examples

@YakDriver YakDriver self-assigned this Jun 4, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jun 4, 2024
@YakDriver
Copy link
Member

Looks like more CI tests are failing.

In addition, I'm getting these errors when running:

us-west-2:

If it's only available in certain regions, the tests need gates.

    ingestion_test.go:156: unexpected PreCheck error: operation error AppFabric: ListAppBundles, https response error StatusCode: 0, RequestID: , request send failed, Get "https://appfabric.us-west-2.amazonaws.com/appbundles": dial tcp: lookup appfabric.us-west-2.amazonaws.com: no such host
--- FAIL: TestAccAppFabricIngestion_disappears (0.46s)
=== NAME  TestAccAppFabricIngestion_basic
    ingestion_test.go:36: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating AWS AppFabric Ingestion ("OKTA"): operation error AppFabric: CreateIngestion, https response error StatusCode: 0, RequestID: , request send failed, Post "https://appfabric.us-west-2.amazonaws.com/appbundles/app-bundle-arn/ingestions": dial tcp: lookup appfabric.us-west-2.amazonaws.com: no such host
        
          with aws_appfabric_ingestion.test,
          on terraform_plugin_test.tf line 12, in resource "aws_appfabric_ingestion" "test":
          12: resource "aws_appfabric_ingestion" "test" {
        
        operation error AppFabric: CreateIngestion, https response error StatusCode:
        0, RequestID: , request send failed, Post
        "https://appfabric.us-west-2.amazonaws.com/appbundles/app-bundle-arn/ingestions":
        dial tcp: lookup appfabric.us-west-2.amazonaws.com: no such host
--- FAIL: TestAccAppFabricIngestion_basic (5.84s)

us-east-1:

Maybe something changed after you ran the tests last?

=== NAME  TestAccAppFabricIngestion_basic
    ingestion_test.go:36: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating AWS AppFabric Ingestion ("OKTA"): operation error AppFabric: CreateIngestion, https response error StatusCode: 400, RequestID: f0828c62-df2b-4d21-b0a7-b5f219db715c, ValidationException: 1 validation error detected: Value 'app-bundle-arn' at 'appBundleIdentifier' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:.+$|^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}
        
          with aws_appfabric_ingestion.test,
          on terraform_plugin_test.tf line 12, in resource "aws_appfabric_ingestion" "test":
          12: resource "aws_appfabric_ingestion" "test" {
        
        operation error AppFabric: CreateIngestion, https response error StatusCode:
        400, RequestID: f0828c62-df2b-4d21-b0a7-b5f219db715c, ValidationException: 1
        validation error detected: Value 'app-bundle-arn' at 'appBundleIdentifier'
        failed to satisfy constraint: Member must satisfy regular expression pattern:
        arn:.+$|^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}
=== NAME  TestAccAppFabricIngestion_disappears
    ingestion_test.go:73: Step 1/1 error: Error running apply: exit status 1
        
        Error: creating AWS AppFabric Ingestion ("OKTA"): operation error AppFabric: CreateIngestion, https response error StatusCode: 400, RequestID: 0bb8921d-5711-44af-8adc-b2734bb271c1, ValidationException: 1 validation error detected: Value 'app-bundle-arn' at 'appBundleIdentifier' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:.+$|^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}
        
          with aws_appfabric_ingestion.test,
          on terraform_plugin_test.tf line 12, in resource "aws_appfabric_ingestion" "test":
          12: resource "aws_appfabric_ingestion" "test" {
        
        operation error AppFabric: CreateIngestion, https response error StatusCode:
        400, RequestID: 0bb8921d-5711-44af-8adc-b2734bb271c1, ValidationException: 1
        validation error detected: Value 'app-bundle-arn' at 'appBundleIdentifier'
        failed to satisfy constraint: Member must satisfy regular expression pattern:
        arn:.+$|^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}

Copy link
Member

@YakDriver YakDriver 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 for your contribution!! It's great to see framework and AWS SDK Go v2!

This probably needs a little bit more love but hopefully not too much:

  • Acceptance tests passing
  • Add gates to acctests if they require regions, env vars, etc.
  • CI tests passing

@meetreks
Copy link
Contributor

meetreks commented Jun 5, 2024

@YakDriver your comments have been addressed, could you check in and see if anything else is required from our side?

@YakDriver YakDriver removed their assignment Jun 11, 2024
@ewbankkit ewbankkit self-assigned this Jun 11, 2024
@ewbankkit
Copy link
Contributor

% AWS_DEFAULT_REGION=us-east-1 make testacc TESTARGS='-run=TestAccAppFabric_serial/Ingestion/basic' PKG=appfabric
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/appfabric/... -v -count 1 -parallel 20  -run=TestAccAppFabric_serial/Ingestion/basic -timeout 360m
=== RUN   TestAccAppFabric_serial
=== PAUSE TestAccAppFabric_serial
=== CONT  TestAccAppFabric_serial
=== RUN   TestAccAppFabric_serial/Ingestion
=== RUN   TestAccAppFabric_serial/Ingestion/basic
    ingestion_test.go:28: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating AppFabric Ingestion
        
          with aws_appfabric_ingestion.test,
          on terraform_plugin_test.tf line 39, in resource "aws_appfabric_ingestion" "test":
          39: resource "aws_appfabric_ingestion" "test" {
        
        operation error AppFabric: CreateIngestion, https response error StatusCode:
        400, RequestID: f0076af6-0e3f-4c8d-a7d9-108849755089, ValidationException:
        The app authorization for the specified application and tenant was not
        connected. Connect the app authorization for the application and tenant
        before creating an ingestion.
--- FAIL: TestAccAppFabric_serial (7.62s)
    --- FAIL: TestAccAppFabric_serial/Ingestion (7.62s)
        --- FAIL: TestAccAppFabric_serial/Ingestion/basic (7.62s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/appfabric	11.967s
FAIL
make: *** [testacc] Error 1

We need a way to call ConnectAppAuthorization.

@meetreks
Copy link
Contributor

@ewbankkit wee have a cli command to do it. How do we include this in the tests? any examples?
aws appfabric create-app-authorization
--region us-east-1
--app-bundle-identifier arn:aws:appfabric:us-east-1:99999999999:appbundle/a9b91477-8831-43c0-970c-95bdc3b06633
--app "OKTA"
--credential '{"oauth2Credential": {"clientId":"","clientSecret":""}}'
--tenant '{"tenantIdentifier": "dev-22002358.okta.com","tenantDisplayName": "AppFabricTesting3"}'
--auth-type "oauth2"

@meetreks
Copy link
Contributor

@ewbankkit we had a huddle and the "gap" is we haven't got a resource for app_connect. what are the options here? when we tested - we used a manual way to auth make our tests pass locally. We can run a local-exec and run a cli command -- is this accepted? Appreciate if you have other suggestions.

@ewbankkit
Copy link
Contributor

@meetreks I am thinking that we should add connect (boolean) and auth_request {} arguments to the aws_appfabric_app_authorization resource?

@meetreks
Copy link
Contributor

@ewbankkit we like your suggestion but it still leaves a gap for oauth2 use cases (its because of the way the work flow is). Let us huddle more and see a way forward. Will keep you posted.

@markoskandylis
Copy link
Contributor

Hi @ewbankkit one resource that is missing at the moment that i plan to work this weekend is https://docs.aws.amazon.com/appfabric/latest/api/API_ConnectAppAuthorization.html not sure if thats the one that will solve the issue

@ewbankkit
Copy link
Contributor

@markoskandylis Yes, I think it would. Thanks.

@markoskandylis
Copy link
Contributor

@ewbankkit I will have that ready at the start of next week and i will run some tests

# Conflicts:
#	internal/service/appfabric/appfabric_test.go
#	internal/service/appfabric/exports_test.go
@ewbankkit ewbankkit requested a review from a team as a code owner June 24, 2024 19:10
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% AWS_APPFABRIC_TERRAFORMCLOUD_TENANT_ID=... AWS_APPFABRIC_TERRAFORMCLOUD_SERVICE_ACCOUNT_TOKEN=... AWS_DEFAULT_REGION=us-east-1 make testacc TESTARGS='-run=TestAccAppFabric_serial/Ingestion' PKG=appfabric
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/appfabric/... -v -count 1 -parallel 20  -run=TestAccAppFabric_serial/Ingestion -timeout 360m
=== RUN   TestAccAppFabric_serial
=== PAUSE TestAccAppFabric_serial
=== CONT  TestAccAppFabric_serial
=== RUN   TestAccAppFabric_serial/Ingestion
=== RUN   TestAccAppFabric_serial/Ingestion/tags
=== RUN   TestAccAppFabric_serial/Ingestion/basic
=== RUN   TestAccAppFabric_serial/Ingestion/disappears
--- PASS: TestAccAppFabric_serial (73.72s)
    --- PASS: TestAccAppFabric_serial/Ingestion (73.71s)
        --- PASS: TestAccAppFabric_serial/Ingestion/tags (33.24s)
        --- PASS: TestAccAppFabric_serial/Ingestion/basic (20.81s)
        --- PASS: TestAccAppFabric_serial/Ingestion/disappears (19.66s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appfabric	78.184s

@ewbankkit
Copy link
Contributor

@davelemons Thanks for the contribution 🎉 👏.

@meetreks
Copy link
Contributor

Many thanks @YakDriver and @ewbankkit for your kind help & support.

@ewbankkit ewbankkit merged commit cc67231 into hashicorp:main Jun 24, 2024
44 checks passed
@github-actions github-actions bot added this to the v5.56.0 milestone Jun 24, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jun 27, 2024
Copy link

This functionality has been released in v5.56.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!

Copy link

github-actions bot commented Aug 1, 2024

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 Aug 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. new-resource Introduces a new resource. partner Contribution from a partner. service/appfabric Issues and PRs that pertain to the appfabric service. size/XL Managed by automation to categorize the size of a PR. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants