Skip to content

Commit

Permalink
Merge pull request #7936 from ministryofjustice/CC-2839/ssm-command-c…
Browse files Browse the repository at this point in the history
…reate-snapshots

CC-2839: SSM command for executing the ec2-create-snapshots-with-tags.py script.
  • Loading branch information
mmgovuk authored Sep 27, 2024
2 parents a8636b8 + 4e09535 commit be75f04
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 8 additions & 0 deletions terraform/environments/ccms-ebs-upgrade/ssm.tf
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 9 additions & 1 deletion terraform/environments/ccms-ebs/ccms-ssm-documents.tf
Original file line number Diff line number Diff line change
@@ -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"

Expand Down

0 comments on commit be75f04

Please sign in to comment.