aws_api_gateway_v2_deployment resource
Use the aws_api_gateway_v2_deployment
InSpec audit resource to test the properties of a specific AWS API Gateway V2 deployment.
For additional information, including parameters and properties, see the AWS documentation on AWS APIGatewayV2 Deployment.
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 the deployment exists.
describe aws_api_gateway_v2_deployment(api_id: 'APP_ID', deployment_id: 'DEPLOYMENT_ID') do
it { should exist }
end
Parameters
api_id
(required)- The API identifier.
deployment_id
(required)- The identifier for the deployment.
Properties
auto_deployed
- Specifies whether the deployment was automatically released.
created_date
- The date and time when the deployment resource was created.
deployment_id
- The identifier for the deployment.
deployment_status
- The status of the deployment. The valid values are
PENDING
,FAILED
, orSUCCEEDED
. deployment_status_message
- May contain additional feedback on the status of an API deployment.
description
- The description for the deployment.
Examples
Test to ensure a deployment ID is available
describe aws_api_gateway_v2_deployment(api_id: 'APP_ID', deployment_id: 'DEPLOYMENT_ID') do
its('deployment_id') { should eq 'DEPLOYMENT_ID' }
end
Test to verify the deployment status
describe aws_api_gateway_v2_deployment(api_id: 'APP_ID', deployment_id: 'DEPLOYMENT_ID') do
its('deployment_status') { should eq 'DEPLOYED' }
end
Test to ensure an authorizer type is JWT
for a deployment
describe aws_api_gateway_v2_deployment(api_id: 'APP_ID', deployment_id: 'DEPLOYMENT_ID') do
its('authorizer_type') { should eq 'JWT' }
end
Test to ensure a description is available
describe aws_api_gateway_v2_deployment(api_id: 'APP_ID', deployment_id: 'DEPLOYMENT_ID') do
its('description') { should eq 'DEPLOYMENT_DESCRIPTION' }
end
Test to ensure an auto-deployment is enabled for a deployment
describe aws_api_gateway_v2_deployment(api_id: 'APP_ID', deployment_id: 'DEPLOYMENT_ID') do
its('auto_deployed') { should eq true }
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 control passes if the get
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_api_gateway_v2_deployment(api_id: 'APP_ID', deployment_id: 'DEPLOYMENT_ID') do
it { should exist }
end
not exists
Use should_not
to test that the entity does not exist.
describe aws_api_gateway_v2_deployment(api_id: 'APP_ID', deployment_id: 'DEPLOYMENT_ID') do
it { should_not exist }
end
AWS Permissions
Your Principal will need the APIGatewayv2:Client:GetDeploymentResponse
action with Effect
set to Allow
.
Was this page helpful?