Skip to content

chore: update dpes (#1268) #3

chore: update dpes (#1268)

chore: update dpes (#1268) #3

name: Publish-CloudFormation
on:
push:
branches:
- main
- "[0-9]+.[0-9]+"
paths:
- deploy/cloudformation/*.yml
- scripts/publish_cft.sh
- .github/workflows/publish-cloudformation.yml
jobs:
publish_cloudformation:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.CSPM_CFT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CSPM_CFT_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Upload to S3 if elastic-agent CloudFormation template has changed
run: |
DATE=$(date +"%Y-%m-%d-%H-%M-%S")
VERSION=$(grep defaultBeatVersion version/version.go | cut -f2 -d "\"")
CNVM_FILENAME="cloudformation-cnvm-$VERSION-$DATE.yml"
./scripts/publish_cft.sh deploy/cloudformation/elastic-agent-ec2-cnvm.yml $CNVM_FILENAME
CSPM_FILENAME="cloudformation-cspm-single-account-$VERSION-$DATE.yml"
./scripts/publish_cft.sh deploy/cloudformation/elastic-agent-ec2-cspm.yml $CSPM_FILENAME
CSPM_ORG_FILENAME="cloudformation-cspm-organization-account-$VERSION-$DATE.yml"
./scripts/publish_cft.sh deploy/cloudformation/elastic-agent-ec2-cspm-organization.yml $CSPM_ORG_FILENAME