Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/VKPR-255' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeedroza committed May 10, 2022
2 parents c0e0690 + 9034aaf commit 505688e
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 0 deletions.
1 change: 1 addition & 0 deletions vkpr/aws/rds/snapshot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

13 changes: 13 additions & 0 deletions vkpr/aws/rds/snapshot/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

BIN_FOLDER=bin
BINARY_NAME_UNIX=run.sh
ENTRY_POINT_UNIX=main.sh
LIB_RESOURCES="../../../../lib/functions/*"

#bash-build:
mkdir -p $BIN_FOLDER/src
cp $LIB_RESOURCES $BIN_FOLDER/src
cp -r src/* $BIN_FOLDER
mv $BIN_FOLDER/$ENTRY_POINT_UNIX $BIN_FOLDER/$BINARY_NAME_UNIX
chmod +x $BIN_FOLDER/$BINARY_NAME_UNIX
33 changes: 33 additions & 0 deletions vkpr/aws/rds/snapshot/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"inputs": [
{
"tutorial": "Specifies the AWS Access Key Credential.",
"name": "aws_access_key",
"type": "CREDENTIAL_AWS_ACCESSKEYID"
},
{
"tutorial": "Specifies the AWS Secret Key Credential.",
"name": "aws_secret_key",
"type": "CREDENTIAL_AWS_SECRETACCESSKEY"
},
{
"tutorial": "Specifies the AWS Region to set the environment.",
"name": "aws_region",
"type": "CREDENTIAL_AWS_REGION"
},
{
"tutorial": "Specifies the RDS instance name to create SNAPSHOT.",
"label": "RDS instance name:",
"name": "rds_instance_name",
"type": "text",
"default": "rds-sample",
"required": true,
"pattern": {
"regex": "^([A-Za-z0-9-]+)$",
"mismatchText": "Invalid Cluster name"
}
}
],
"template": "shell-bat",
"templateRelease:": "2.16.2"
}
4 changes: 4 additions & 0 deletions vkpr/aws/rds/snapshot/help.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"short": "",
"long": ""
}
18 changes: 18 additions & 0 deletions vkpr/aws/rds/snapshot/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"execution": [
"local"
],
"os": {
"deps": [],
"support": [
"mac",
"linux"
]
},
"tags": [
"vkpr",
"aws",
"rds",
"snapshot"
]
}
12 changes: 12 additions & 0 deletions vkpr/aws/rds/snapshot/src/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# shellcheck source=/dev/null
source src/log.sh
source src/var.sh
source src/helper.sh
source src/validate.sh
source src/versions.sh

. "$(dirname "$0")"/unix/formula/formula.sh --source-only

runFormula
13 changes: 13 additions & 0 deletions vkpr/aws/rds/snapshot/src/unix/formula/formula.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash


runFormula() {

validateAwsSecretKey "$AWS_SECRET_KEY"
validateAwsAccessKey "$AWS_ACCESS_KEY"
validateAwsRegion "$AWS_REGION"

aws rds create-db-snapshot \
--db-instance-identifier $RDS_INSTANCE_NAME \
--db-snapshot-identifier mydbsnapshot 1> /dev/null && echo "Snapshot created"
}

0 comments on commit 505688e

Please sign in to comment.