aws_amplify_branches resource
Use the aws_amplify_branches InSpec audit resource to test the properties of multiple AWS Amplify branches.
For additional information, including details on parameters and properties, see the AWS documentation on AWS Amplify branch.
Syntax
Ensure that AWS Amplify branch exists.
describe aws_amplify_branches(app_id: 'APP_ID') do
it { should exist }
end
Parameters
app_id(required)The unique ID for an Amplify app.
Properties
branch_arns- The Amazon Resource Name (ARN) for a branch that is part of an Amplify app.
Field:
branch_arnbranch_names- The name for the branch that is part of an Amplify app.
Field:
branch_namedescriptions- The description for the branch that is part of an Amplify app.
Field:
description- The tag for the branch of an Amplify app.
Field:
tagsstage- The current stage for the branch that is part of an Amplify app.
Field:
stagedisplay_names- The display_name for the Amplify branch.
Field:
display_nameplatforms- The platform for the Amplify branch.
Field:
platformcreate_time- Creates a date and time for the Amplify branch.
Field:
create_timeupdate_time- Updates the date and time for the Amplify branch.
Field:
update_timeenvironment_variables- The environment variables for the Amplify branch.
Field:
environment_variablesenable_pull_request_preview- The app engine version to upgrade to.
Field:
enable_pull_request_previewcustom_domains- The custom domain for the Amplify branch.
Field:
custom_domainpull_request_environment_names- Automatically disconnect a branch in the Amplify Console when you delete a branch from your Git repository.
Field:
pull_request_environment_nameenable_basic_auth- Enables basic authorization for the Amplify branch’s branches.
Field:
enable_basic_auth
Examples
Ensure a branch ID is available:
describe aws_amplify_branches(app_id: 'APP_ID') do
its('branch_arns') { should include 'BranchARN' }
end
Ensure a branch name is available:
describe aws_amplify_branches(app_id: 'APP_ID') do
its('branch_names') { should include 'BranchName' }
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_amplify_branches(app_id: 'APP_ID') do
it { should exist }
end
Use should_not to test the entity does not exist.
describe aws_amplify_branches(app_id: 'dummy') do
it { should_not exist }
end
be_available
Use should to check if the Amplify branch is available.
describe aws_amplify_branches(app_id: 'APP_ID') do
it { should be_available }
end
AWS Permissions
Your AWS principal will need the Amplify:Client:ListBranchesResult action with Effect set to Allow.