hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.1k forks source link

[New Resource]: New Service Catalog data source "aws_servicecatalog_list_accepted_portfolio_shares" #33673

Open Just-ZJ opened 11 months ago

Just-ZJ commented 11 months ago

Description

Terraform currently lacks a data source which lists all imported portfolios for which account-to-account shares were accepted by an account. There is an equivalent in Python SDK and CloudFormation but is currently not supported by Terraform AWS Provider.

Python SDK: https://boto3.amazonaws.com/v1/documentation/api/1.26.87/reference/services/servicecatalog/client/list_accepted_portfolio_shares.html

AWS CloudFormation: https://docs.aws.amazon.com/servicecatalog/latest/dg/API_ListAcceptedPortfolioShares.html

Requested Resource(s) and/or Data Source(s)

aws_servicecatalog_list_accepted_portfolio_shares

Potential Terraform Configuration

data "aws_servicecatalog_list_accepted_portfolio_shares" "example" {
  portfolio_share_type = "AWS_ORGANIZATIONS"
}

References

https://boto3.amazonaws.com/v1/documentation/api/1.26.87/reference/services/servicecatalog/client/list_accepted_portfolio_shares.html https://docs.aws.amazon.com/servicecatalog/latest/dg/API_ListAcceptedPortfolioShares.html

Would you like to implement a fix?

None

github-actions[bot] commented 11 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

autotune commented 11 months ago

I'd like to take this on. Creating a new data source is new to me so if I am unable to do so for whatever reason I will make another comment.

autotune commented 11 months ago

This is mostly done just need to add tests. I modified it so it lists account status of all shares rather than just accepted.