This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove --removal-policy arg and hardcode DESTROY in its place; set de…
…fault pending window days to 7 Signed-off-by: Grant Linville <[email protected]>
- Loading branch information
1 parent
873b14d
commit 1223172
Showing
5 changed files
with
6 additions
and
34 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
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 |
---|---|---|
|
@@ -26,7 +26,6 @@ type KMSKeyStackProps struct { | |
KeyUsage string `json:"keyUsage"` | ||
PendingWindowDays int `json:"pendingWindowDays"` | ||
KeyPolicy map[string]interface{} `json:"keyPolicy"` | ||
RemovalPolicy string `json:"removalPolicy"` | ||
} | ||
|
||
// Source: https://pkg.go.dev/github.com/aws/aws-cdk-go/awscdk/v2/[email protected]#KeySpec | ||
|
@@ -56,14 +55,11 @@ func (ksp *KMSKeyStackProps) SetDefaults() { | |
ksp.KeyUsage = "ENCRYPT_DECRYPT" | ||
} | ||
if ksp.PendingWindowDays == 0 { | ||
ksp.PendingWindowDays = 30 | ||
ksp.PendingWindowDays = 7 | ||
} | ||
if ksp.Description == "" { | ||
ksp.Description = "Acorn created KMS Key" | ||
} | ||
if ksp.RemovalPolicy == "" { | ||
ksp.RemovalPolicy = "DESTROY" | ||
} | ||
} | ||
|
||
func (ksp *KMSKeyStackProps) ValidateProps() error { | ||
|
@@ -79,9 +75,6 @@ func (ksp *KMSKeyStackProps) ValidateProps() error { | |
if ksp.PendingWindowDays < 7 || ksp.PendingWindowDays > 30 { | ||
errs = append(errs, fmt.Errorf("pendingWindowDays must be between 7 and 30 (inclusive)")) | ||
} | ||
if ksp.RemovalPolicy != "DESTROY" && ksp.RemovalPolicy != "RETAIN" { | ||
errs = append(errs, fmt.Errorf("removalPolicy must be either DESTROY or RETAIN")) | ||
} | ||
return errors.Join(errs...) | ||
} | ||
|
||
|
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