Skip to main content

aws_cognito_userpool_clients Resource

Use the aws_cognito_userpool_clients InSpec audit resource to test properties of multiple Cognito user pool clients.

For additional information, including details on parameters and properties, see the AWS documentation on Cognito user pool.

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 a user pool client exists.

describe aws_cognito_userpool_clients(user_pool_id: 'USER_POOL_ID') do
  it { should exist }
end

Parameters

user_pool_id (required)

Properties

client_ids
The client IDs of the user pools.
user_pool_ids
The user pool IDs of the user pools.
client_names
The client names of the user pools.

Examples

Ensure that the specific client ID is available.

describe aws_cognito_userpool_clients(user_pool_id: 'USER_POOL_ID') do
  its('client_ids') { should include 'CLIENT_ID' }
end

Ensure that the specific client name is available.

describe aws_cognito_userpool_clients(user_pool_id: 'USER_POOL_ID') do
    its('client_names') { should include 'CLIENT_NAME' }
end

Matchers

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

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

exist

Use should to test that the entity exists.

describe aws_cognito_userpool_clients(user_pool_id: 'USER_POOL_ID') do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_cognito_userpool_clients(user_pool_id: 'USER_POOL_ID') do
  it { should_not exist }
end

be_available

Use should to check if the user pool clients are available.

describe aws_cognito_userpool_clients(user_pool_id: 'USER_POOL_ID') do
  it { should be_available }
end

AWS Permissions

Your Principal will need the CognitoIdentityProvider:Client:ListUserPoolClientsResponse action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×










Search Results