diff --git a/terraform/environments/ccms-ebs-upgrade/ssm-create-backup-snapshots.yaml b/terraform/environments/ccms-ebs-upgrade/ssm-create-backup-snapshots.yaml new file mode 100644 index 00000000000..580c41da485 --- /dev/null +++ b/terraform/environments/ccms-ebs-upgrade/ssm-create-backup-snapshots.yaml @@ -0,0 +1,15 @@ +# ssm-create-backup-snapshots.yaml +--- +schemaVersion: "2.2" +description: Run the ec2-create-snapshots-with-tags.py script. +mainSteps: + - name: OracleCreateBackupSnapshots + action: aws:runShellScript + isEnd: true + precondition: + StringEquals: + - platformType + - Linux + inputs: + runCommand: + - "/root/aws-scripts/ec2-create-snapshots-with-tags.py" \ No newline at end of file diff --git a/terraform/environments/ccms-ebs-upgrade/ssm.tf b/terraform/environments/ccms-ebs-upgrade/ssm.tf index 998822fc365..4a0d3f8b723 100644 --- a/terraform/environments/ccms-ebs-upgrade/ssm.tf +++ b/terraform/environments/ccms-ebs-upgrade/ssm.tf @@ -1,3 +1,11 @@ +resource "aws_ssm_document" "create_backup_snapshots" { + name = "CCMS-Create-Backup-Snapshots" + document_type = "Command" + document_format = "YAML" + + content = file("ssm-create-backup-snapshots.yaml") +} + resource "aws_ssm_document" "oracle_lms_cpuq" { name = "Oracle-lms-cpuq" document_type = "Command" diff --git a/terraform/environments/ccms-ebs/ccms-ssm-create-backup-snapshots.yaml b/terraform/environments/ccms-ebs/ccms-ssm-create-backup-snapshots.yaml new file mode 100644 index 00000000000..7b9dd23642c --- /dev/null +++ b/terraform/environments/ccms-ebs/ccms-ssm-create-backup-snapshots.yaml @@ -0,0 +1,15 @@ +# ccms-ssm-create-backup-snapshots.yaml +--- +schemaVersion: "2.2" +description: Run the ec2-create-snapshots-with-tags.py script. +mainSteps: + - name: OracleCreateBackupSnapshots + action: aws:runShellScript + isEnd: true + precondition: + StringEquals: + - platformType + - Linux + inputs: + runCommand: + - "/root/aws-scripts/ec2-create-snapshots-with-tags.py" \ No newline at end of file diff --git a/terraform/environments/ccms-ebs/ccms-ssm-documents.tf b/terraform/environments/ccms-ebs/ccms-ssm-documents.tf index 8d3d96b2276..77c94f5c95a 100644 --- a/terraform/environments/ccms-ebs/ccms-ssm-documents.tf +++ b/terraform/environments/ccms-ebs/ccms-ssm-documents.tf @@ -1,5 +1,13 @@ +resource "aws_ssm_document" "create_backup_snapshots" { + name = "CCMS-Create-Backup-Snapshots" + document_type = "Command" + document_format = "YAML" + + content = file("ccms-ssm-create-backup-snapshots.yaml") +} + resource "aws_ssm_document" "service_actions" { - name = "ServiceActions" + name = "CCMS-Service-Actions" document_type = "Command" document_format = "YAML"