Skip to main content

aws_cognito_userpool_clients Resource

[edit on GitHub]

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.

Installation

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

See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.

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

This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit 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.

Was this page helpful?

×









Search Results