-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aws-rds): create formula snapshot db
- Loading branch information
Nathan VTG
committed
May 6, 2022
1 parent
b168e03
commit 9034aaf
Showing
7 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"short": "", | ||
"long": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |