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

ds/servicecatalog_portfolio: New data source #19500

Merged
merged 9 commits into from
Jun 17, 2021
Merged

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented May 24, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #15369
Relates #18074
Relates #1694

Output from acceptance testing (us-west-2):

--- PASS: TestAccAWSServiceCatalogPortfolioDataSource_basic (13.60s)

Output from acceptance testing (GovCloud):

--- PASS: TestAccAWSServiceCatalogPortfolioDataSource_basic (16.36s)

@YakDriver YakDriver requested a review from a team as a code owner May 24, 2021 16:48
@ghost ghost added size/L Managed by automation to categorize the size of a PR. labels May 24, 2021
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/servicecatalog Issues and PRs that pertain to the servicecatalog service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 24, 2021
@anGie44 anGie44 self-assigned this Jun 16, 2021
@@ -0,0 +1,3 @@
```release-notes:new-data-source
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
```release-notes:new-data-source
```release-note:new-data-source

Provides information for a Service Catalog Portfolio.
---

# Data source: aws_servicecatalog_portfolio
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: looks like the majority of our ds use the capital letter

Suggested change
# Data source: aws_servicecatalog_portfolio
# Data Source: aws_servicecatalog_portfolio


The following arguments are required:

* `id` - (Optional) Portfolio identifier.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `id` - (Optional) Portfolio identifier.
* `id` - (Required) Portfolio identifier.

output, err := conn.DescribePortfolio(input)

if err != nil {
return fmt.Errorf("error getting Service Catalog Portfolio: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also be helpful to include the id here in cases users have multiple of these data sources

Suggested change
return fmt.Errorf("error getting Service Catalog Portfolio: %w", err)
return fmt.Errorf("error getting Service Catalog Portfolio (%s): %w", d.Get("id").(string), err)

}

if output == nil || output.PortfolioDetail == nil {
return fmt.Errorf("error getting Service Catalog Portfolio: empty response")
Copy link
Contributor

Choose a reason for hiding this comment

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

similar comment as above

Comment on lines 81 to 83
if err := d.Set("created_time", detail.CreatedTime.Format(time.RFC3339)); err != nil {
log.Printf("[DEBUG] Error setting created_time: %s", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure what the norm for these are, but just mentioning that i've also seen a non-error in-line usage e.g. aws.TimeValue(detail.CreatedTime).Format(time.RFC3339) that could be used here in place. do you think we'll miss the debug log though?

Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

Just a couple small comments, otherwise LGTM

Output of acceptance test:

--- PASS: TestAccAWSServiceCatalogPortfolioDataSource_basic (18.49s)

@YakDriver YakDriver force-pushed the f-servicecat-ds-portfolio branch from af61985 to d6c006a Compare June 17, 2021 18:49
@YakDriver YakDriver added this to the v3.46.0 milestone Jun 17, 2021
@YakDriver YakDriver merged commit 2eb601b into main Jun 17, 2021
@YakDriver YakDriver deleted the f-servicecat-ds-portfolio branch June 17, 2021 19:59
github-actions bot pushed a commit that referenced this pull request Jun 17, 2021
@github-actions
Copy link

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

@github-actions
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 Jul 18, 2021
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. provider Pertains to the provider itself, rather than any interaction with AWS. service/servicecatalog Issues and PRs that pertain to the servicecatalog service. size/L Managed by automation to categorize the size of a PR. 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.

2 participants