-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add conditional logic for instances & clusters
- Loading branch information
Showing
8 changed files
with
548 additions
and
23 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,260 @@ | ||
{ | ||
"DBInstances": [ | ||
{ | ||
"DBInstanceIdentifier": "workflows-1", | ||
"DBInstanceClass": "db.t3.medium", | ||
"Engine": "aurora-postgresql", | ||
"DBInstanceStatus": "available", | ||
"MasterUsername": "root", | ||
"Endpoint": { | ||
"Address": "workflows-1.cpqbmoxjvrwl.eu-west-2.rds.amazonaws.com", | ||
"Port": 5432, | ||
"HostedZoneId": "Z1TTGA775OQIYO" | ||
}, | ||
"AllocatedStorage": 1, | ||
"InstanceCreateTime": "2023-02-07T09:27:19.953000+00:00", | ||
"PreferredBackupWindow": "22:45-23:15", | ||
"BackupRetentionPeriod": 7, | ||
"DBSecurityGroups": [], | ||
"VpcSecurityGroups": [ | ||
{ | ||
"VpcSecurityGroupId": "sg-0cd4feba612cdec6c", | ||
"Status": "active" | ||
}, | ||
{ | ||
"VpcSecurityGroupId": "sg-02e24fd8cee6cff6f", | ||
"Status": "active" | ||
} | ||
], | ||
"DBParameterGroups": [ | ||
{ | ||
"DBParameterGroupName": "default.aurora-postgresql13", | ||
"ParameterApplyStatus": "in-sync" | ||
} | ||
], | ||
"AvailabilityZone": "eu-west-2a", | ||
"DBSubnetGroup": { | ||
"DBSubnetGroupName": "main", | ||
"DBSubnetGroupDescription": "main", | ||
"VpcId": "vpc-021aa0ba490c6473f", | ||
"SubnetGroupStatus": "Complete", | ||
"Subnets": [ | ||
{ | ||
"SubnetIdentifier": "subnet-065541a23e15c695b", | ||
"SubnetAvailabilityZone": { | ||
"Name": "eu-west-2a" | ||
}, | ||
"SubnetOutpost": {}, | ||
"SubnetStatus": "Active" | ||
}, | ||
{ | ||
"SubnetIdentifier": "subnet-0536889152695e141", | ||
"SubnetAvailabilityZone": { | ||
"Name": "eu-west-2b" | ||
}, | ||
"SubnetOutpost": {}, | ||
"SubnetStatus": "Active" | ||
}, | ||
{ | ||
"SubnetIdentifier": "subnet-0103139883ddc9ae9", | ||
"SubnetAvailabilityZone": { | ||
"Name": "eu-west-2c" | ||
}, | ||
"SubnetOutpost": {}, | ||
"SubnetStatus": "Active" | ||
} | ||
] | ||
}, | ||
"PreferredMaintenanceWindow": "thu:23:42-fri:00:12", | ||
"PendingModifiedValues": {}, | ||
"MultiAZ": false, | ||
"EngineVersion": "13.9", | ||
"AutoMinorVersionUpgrade": false, | ||
"ReadReplicaDBInstanceIdentifiers": [], | ||
"LicenseModel": "postgresql-license", | ||
"OptionGroupMemberships": [ | ||
{ | ||
"OptionGroupName": "default:aurora-postgresql-13", | ||
"Status": "in-sync" | ||
} | ||
], | ||
"PubliclyAccessible": false, | ||
"StorageType": "aurora", | ||
"DbInstancePort": 0, | ||
"DBClusterIdentifier": "workflows", | ||
"StorageEncrypted": true, | ||
"KmsKeyId": "arn:aws:kms:eu-west-2:267725517792:key/7085b38b-1cc1-427e-b089-5f94da276b79", | ||
"DbiResourceId": "db-GHZLLZA4YKIOD3BH2QYK6CBVKY", | ||
"CACertificateIdentifier": "rds-ca-2019", | ||
"DomainMemberships": [], | ||
"CopyTagsToSnapshot": false, | ||
"MonitoringInterval": 15, | ||
"EnhancedMonitoringResourceArn": "arn:aws:logs:eu-west-2:267725517792:log-group:RDSOSMetrics:log-stream:db-GHZLLZA4YKIOD3BH2QYK6CBVKY", | ||
"MonitoringRoleArn": "arn:aws:iam::267725517792:role/rds-monitoring-role", | ||
"PromotionTier": 0, | ||
"DBInstanceArn": "arn:aws:rds:eu-west-2:267725517792:db:workflows-1", | ||
"IAMDatabaseAuthenticationEnabled": false, | ||
"PerformanceInsightsEnabled": true, | ||
"PerformanceInsightsKMSKeyId": "arn:aws:kms:eu-west-2:267725517792:key/7085b38b-1cc1-427e-b089-5f94da276b79", | ||
"PerformanceInsightsRetentionPeriod": 7, | ||
"DeletionProtection": false, | ||
"AssociatedRoles": [], | ||
"TagList": [ | ||
{ | ||
"Key": "VantaDescription", | ||
"Value": "Workflows RDS Aurora cluster" | ||
}, | ||
{ | ||
"Key": "VantaContainsUserData", | ||
"Value": "true" | ||
}, | ||
{ | ||
"Key": "VantaOwner", | ||
"Value": "ostriches" | ||
}, | ||
{ | ||
"Key": "service", | ||
"Value": "workflows" | ||
} | ||
], | ||
"CustomerOwnedIpEnabled": false, | ||
"BackupTarget": "region", | ||
"NetworkType": "IPV4", | ||
"StorageThroughput": 0, | ||
"CertificateDetails": { | ||
"CAIdentifier": "rds-ca-2019", | ||
"ValidTill": "2024-08-22T17:08:50+00:00" | ||
} | ||
} | ||
] | ||
} | ||
{ | ||
"DBInstances": [ | ||
{ | ||
"DBInstanceIdentifier": "workflows-1", | ||
"DBInstanceClass": "db.t3.medium", | ||
"Engine": "aurora-postgresql", | ||
"DBInstanceStatus": "available", | ||
"MasterUsername": "root", | ||
"Endpoint": { | ||
"Address": "workflows-1.cpqbmoxjvrwl.eu-west-2.rds.amazonaws.com", | ||
"Port": 5432, | ||
"HostedZoneId": "Z1TTGA775OQIYO" | ||
}, | ||
"AllocatedStorage": 1, | ||
"InstanceCreateTime": "2023-02-07T09:27:19.953000+00:00", | ||
"PreferredBackupWindow": "22:45-23:15", | ||
"BackupRetentionPeriod": 7, | ||
"DBSecurityGroups": [], | ||
"VpcSecurityGroups": [ | ||
{ | ||
"VpcSecurityGroupId": "sg-0cd4feba612cdec6c", | ||
"Status": "active" | ||
}, | ||
{ | ||
"VpcSecurityGroupId": "sg-02e24fd8cee6cff6f", | ||
"Status": "active" | ||
} | ||
], | ||
"DBParameterGroups": [ | ||
{ | ||
"DBParameterGroupName": "default.aurora-postgresql13", | ||
"ParameterApplyStatus": "in-sync" | ||
} | ||
], | ||
"AvailabilityZone": "eu-west-2a", | ||
"DBSubnetGroup": { | ||
"DBSubnetGroupName": "main", | ||
"DBSubnetGroupDescription": "main", | ||
"VpcId": "vpc-021aa0ba490c6473f", | ||
"SubnetGroupStatus": "Complete", | ||
"Subnets": [ | ||
{ | ||
"SubnetIdentifier": "subnet-065541a23e15c695b", | ||
"SubnetAvailabilityZone": { | ||
"Name": "eu-west-2a" | ||
}, | ||
"SubnetOutpost": {}, | ||
"SubnetStatus": "Active" | ||
}, | ||
{ | ||
"SubnetIdentifier": "subnet-0536889152695e141", | ||
"SubnetAvailabilityZone": { | ||
"Name": "eu-west-2b" | ||
}, | ||
"SubnetOutpost": {}, | ||
"SubnetStatus": "Active" | ||
}, | ||
{ | ||
"SubnetIdentifier": "subnet-0103139883ddc9ae9", | ||
"SubnetAvailabilityZone": { | ||
"Name": "eu-west-2c" | ||
}, | ||
"SubnetOutpost": {}, | ||
"SubnetStatus": "Active" | ||
} | ||
] | ||
}, | ||
"PreferredMaintenanceWindow": "thu:23:42-fri:00:12", | ||
"PendingModifiedValues": {}, | ||
"MultiAZ": false, | ||
"EngineVersion": "13.9", | ||
"AutoMinorVersionUpgrade": false, | ||
"ReadReplicaDBInstanceIdentifiers": [], | ||
"LicenseModel": "postgresql-license", | ||
"OptionGroupMemberships": [ | ||
{ | ||
"OptionGroupName": "default:aurora-postgresql-13", | ||
"Status": "in-sync" | ||
} | ||
], | ||
"PubliclyAccessible": false, | ||
"StorageType": "aurora", | ||
"DbInstancePort": 0, | ||
"DBClusterIdentifier": "workflows", | ||
"StorageEncrypted": true, | ||
"KmsKeyId": "arn:aws:kms:eu-west-2:267725517792:key/7085b38b-1cc1-427e-b089-5f94da276b79", | ||
"DbiResourceId": "db-GHZLLZA4YKIOD3BH2QYK6CBVKY", | ||
"CACertificateIdentifier": "rds-ca-2019", | ||
"DomainMemberships": [], | ||
"CopyTagsToSnapshot": false, | ||
"MonitoringInterval": 15, | ||
"EnhancedMonitoringResourceArn": "arn:aws:logs:eu-west-2:267725517792:log-group:RDSOSMetrics:log-stream:db-GHZLLZA4YKIOD3BH2QYK6CBVKY", | ||
"MonitoringRoleArn": "arn:aws:iam::267725517792:role/rds-monitoring-role", | ||
"PromotionTier": 0, | ||
"DBInstanceArn": "arn:aws:rds:eu-west-2:267725517792:db:workflows-1", | ||
"IAMDatabaseAuthenticationEnabled": false, | ||
"PerformanceInsightsEnabled": true, | ||
"PerformanceInsightsKMSKeyId": "arn:aws:kms:eu-west-2:267725517792:key/7085b38b-1cc1-427e-b089-5f94da276b79", | ||
"PerformanceInsightsRetentionPeriod": 7, | ||
"DeletionProtection": false, | ||
"AssociatedRoles": [], | ||
"TagList": [ | ||
{ | ||
"Key": "VantaDescription", | ||
"Value": "Workflows RDS Aurora cluster" | ||
}, | ||
{ | ||
"Key": "VantaContainsUserData", | ||
"Value": "true" | ||
}, | ||
{ | ||
"Key": "VantaOwner", | ||
"Value": "ostriches" | ||
}, | ||
{ | ||
"Key": "service", | ||
"Value": "workflows" | ||
} | ||
], | ||
"CustomerOwnedIpEnabled": false, | ||
"BackupTarget": "region", | ||
"NetworkType": "IPV4", | ||
"StorageThroughput": 0, | ||
"CertificateDetails": { | ||
"CAIdentifier": "rds-ca-2019", | ||
"ValidTill": "2024-08-22T17:08:50+00:00" | ||
} | ||
} | ||
] | ||
} |
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
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
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
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,24 @@ | ||
package handler | ||
|
||
import ( | ||
"context" | ||
"log" | ||
|
||
"github.com/aws/aws-sdk-go-v2/config" | ||
) | ||
|
||
// Assert AWS Credentials are configured | ||
func AssertCredentials() { | ||
|
||
cfg, err := config.LoadDefaultConfig(context.TODO()) | ||
if err != nil { | ||
log.Panic("configuration error: " + err.Error()) | ||
} | ||
|
||
if cfg.Credentials != nil { | ||
log.Println("Credentials found @ " + cfg.Region) | ||
} else { | ||
log.Fatal("Configuration Error. No AWS credentials configured: " + err.Error()) | ||
} | ||
|
||
} |
Oops, something went wrong.