diff --git a/resources/appconfig-deploymentstrategies.go b/resources/appconfig-deploymentstrategies.go index c88d103e..aedf0b34 100644 --- a/resources/appconfig-deploymentstrategies.go +++ b/resources/appconfig-deploymentstrategies.go @@ -1,6 +1,9 @@ package resources import ( + "fmt" + "strings" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/appconfig" @@ -39,6 +42,13 @@ func ListAppConfigDeploymentStrategies(sess *session.Session) ([]Resource, error return resources, nil } +func (f *AppConfigDeploymentStrategy) Filter() error { + if strings.HasPrefix(*f.name, "AppConfig.") { + return fmt.Errorf("cannot delete predefined Deployment Strategy") + } + return nil +} + func (f *AppConfigDeploymentStrategy) Remove() error { _, err := f.svc.DeleteDeploymentStrategy(&appconfig.DeleteDeploymentStrategyInput{ DeploymentStrategyId: f.id,