Skip to main content

aws_servicecatalog_portfolio_principal_associations Resource

Use the aws_servicecatalog_portfolio_principal_associations InSpec audit resource to test properties of a single specific AWS Service Catalog portfolio principal association.

For additional information, including details on parameters and properties, see the AWS documentation on AWS Service Catalog Portfolio Principal Association.

Install

This resource is available in the Chef InSpec AWS resource pack.

For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.

Syntax

Ensure that portfolio are available.

describe aws_servicecatalog_portfolio_principal_associations(portfolio_id: 'PORTFOLIO_ID') do
  it { should exist }
end

Parameters

portfolio_id (required)

The ID of the portfolio.

Properties

principal_arns
The ARN of the principal (IAM user, role, or group).
principal_types
The principal type. The supported value is IAM.

Examples

Ensure a principal ARN is available.

describe aws_servicecatalog_portfolio_principal_associations(portfolio_id: 'PORTFOLIO_ID') do
  its('principal_arns') { should include 'PRINCIPAL_ARN' }
end

Ensure a principal type is ‘IAM’.

describe aws_servicecatalog_portfolio_principal_associations(portfolio_id: 'PORTFOLIO_ID') do
    its('principal_types') { should include 'IAM' }
end

Matchers

For a full list of available matchers, see our Universal Matchers page.

The controls will pass if the describe method returns at least one result.

exist

Use should to test that the entity exists.

describe aws_servicecatalog_portfolio_principal_associations(portfolio_id: 'PORTFOLIO_ID') do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_servicecatalog_portfolio_principal_associations(portfolio_id: 'PORTFOLIO_ID') do
  it { should_not exist }
end

AWS Permissions

Your Principal will need the ServiceCatalog:Client:ListPrincipalsForPortfolioOutput action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×









Search Results