We are going to perform the following steps:
Here are the steps you need to follow to “Invoking the Lambda”
Navigate to the ServiceCatalogPuppet CodeCommit repository again
Click on manifest.yaml
Click Edit
Append the following snippet to the end of the main input field:
lambda-invocations:
delete-default-networking:
function_name: DeleteDefaultNetworking
qualifier: $LATEST
invocation_type: Event
depends_on:
- name: "delete-default-networking-function"
type: "stack"
affinity: "stack"
invoke_for:
tags:
- regions: "default_region"
tag: "type:prod"
accounts:
- account_id: "${AWS::PuppetAccountId}"
name: "puppet-account"
default_region: "eu-west-1"
regions_enabled:
- "eu-west-1"
tags:
- "type:prod"
- "partition:eu"
stacks:
delete-default-networking-function:
name: "delete-default-networking-function"
version: "v1"
capabilities:
- CAPABILITY_NAMED_IAM
deploy_to:
tags:
- tag: "type:prod"
regions: "default_region"
lambda-invocations:
delete-default-networking:
function_name: DeleteDefaultNetworking
qualifier: $LATEST
invocation_type: Event
depends_on:
- name: "delete-default-networking-function"
type: "stack"
affinity: "stack"
invoke_for:
tags:
- regions: "default_region"
tag: "type:prod"
Now that we have written the manifest file we are ready to commit it.
Using a good / unique commit message will help you understand what is going on later.
The YAML we pasted in the previous step told the framework to perform the following actions:
Once the pipeline has completed you can verify the lambda was invoked by verifying there is no default VPC in the default region of your account or you can check the AWS CloudWatch logs for the AWS Lambda function or you could check the execution history for the Lambda function.