Skip to content

Commit

Permalink
update rds instance cft map (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-gogia authored Oct 19, 2022
1 parent baf1dfd commit 730c83f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/mapper/iac-providers/cft/config/db-instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ type DBInstanceConfig struct {
KmsKeyID string `json:"kms_key_id,omitempty"`
IamDBAuthEnabled bool `json:"iam_database_authentication_enabled"`
PubliclyAccessible bool `json:"publicly_accessible"`
BackupRetentionPeriod int `json:"backup_retention_period"`
Username string `json:"username"`
Password string `json:"password"`
InstanceClass string `json:"instance_class"`
Engine string `json:"engine"`
EngineVersion string `json:"engine_version"`
Identifier string `json:"identifier"`
StorageType string `json:"storage_type"`
DeleteAutomatedBackups bool `json:"delete_automated_backups"`
DeletionProtection bool `json:"deletion_protection"`
}

// GetDBInstanceConfig returns config for aws_db_instance
Expand All @@ -47,7 +57,18 @@ func GetDBInstanceConfig(d *rds.DBInstance) []AWSResourceConfig {
CaCertIdentifier: functions.GetVal(d.CACertificateIdentifier),
IamDBAuthEnabled: functions.GetVal(d.EnableIAMDatabaseAuthentication),
PubliclyAccessible: functions.GetVal(d.PubliclyAccessible),
BackupRetentionPeriod: functions.GetVal(d.BackupRetentionPeriod),
Username: functions.GetVal(d.MasterUsername),
Password: functions.GetVal(d.MasterUserPassword),
InstanceClass: functions.GetVal(d.DBInstanceClass),
Engine: functions.GetVal(d.Engine),
EngineVersion: functions.GetVal(d.EngineVersion),
Identifier: functions.GetVal(d.DBInstanceIdentifier),
StorageType: functions.GetVal(d.StorageType),
DeleteAutomatedBackups: functions.GetVal(d.DeleteAutomatedBackups),
DeletionProtection: functions.GetVal(d.DeletionProtection),
}

return []AWSResourceConfig{{
Resource: cf,
Metadata: d.AWSCloudFormationMetadata,
Expand Down

0 comments on commit 730c83f

Please sign in to comment.