You can now use #{AWS::AccountId}, #{AWS::Region}, etc. in any of your config strings, and this plugin replaces those values with the proper pseudo parameter Fn::Sub CloudFormation function.
Unfortunately, it appears that the currently available release of serverless-s3-remover cannot perform these same expansions and is effectively incompatible with serverless-pseudo-parameters.
Expected results:
$ sls remove
S3 Remover: rmarable-test-bucket-****-us-east-1-201902242628-dev empty. Are you sure? [yes/no]: yes
S3 Remover: Success: rmarable-test-bucket-****-us-east-1-201902242628-dev is empty.
Serverless: Getting all objects in S3 bucket...
Serverless: Removing objects in S3 bucket...
Serverless: Removing Stack...
Serverless: Checking Stack removal progress...
.................................................
Serverless: Stack removal finished...
Actual results:
$ sls remove
S3 Remover: Make rmarable-test-bucket-#{AWS::AccountId}-us-east-1-201902242628-dev empty. Are you sure? [yes/no]: yes
S3 Remover: Faild: rmarable-test-bucket-#{AWS::AccountId}-us-east-1-201902242628-dev may not be empty.
Serverless: Getting all objects in S3 bucket...
$ sls remove
S3 Remover: Make rmarable-test-bucket-#{AWS::AccountId}-us-east-1-201902242628-dev empty. Are you sure? [yes/no]: no
S3 Remover: Remove cancelled: rmarable-test-bucket-#{AWS::AccountId}-us-east-1-201902242628-dev
1 validation error detected: Value 'RDSManagementToolsStack-#{AWS::AccountId}-us-east-1-20190224v01-dev' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]|arn:[-a-zA-Z0-9:/._+]
Since expansion of Cloudformation pseudo parameters is more important than having to deal with clearing out a bucket before removing a serverless stack, I will have to disable this very useful plugin until this bug has been addressed (or explained if this is expected behavior).
serverless-pseudo-parameters (https://github.com/svdgraaf/serverless-pseudo-parameters) is a plugin that makes it much easier to use Cloudformation pseudo parameters in serverless.yml. From the documentation:
You can now use #{AWS::AccountId}, #{AWS::Region}, etc. in any of your config strings, and this plugin replaces those values with the proper pseudo parameter Fn::Sub CloudFormation function.
Unfortunately, it appears that the currently available release of serverless-s3-remover cannot perform these same expansions and is effectively incompatible with serverless-pseudo-parameters.
Expected results:
$ sls remove S3 Remover: rmarable-test-bucket-****-us-east-1-201902242628-dev empty. Are you sure? [yes/no]: yes S3 Remover: Success: rmarable-test-bucket-****-us-east-1-201902242628-dev is empty. Serverless: Getting all objects in S3 bucket... Serverless: Removing objects in S3 bucket... Serverless: Removing Stack... Serverless: Checking Stack removal progress... ................................................. Serverless: Stack removal finished...
Actual results:
$ sls remove S3 Remover: Make rmarable-test-bucket-#{AWS::AccountId}-us-east-1-201902242628-dev empty. Are you sure? [yes/no]: yes S3 Remover: Faild: rmarable-test-bucket-#{AWS::AccountId}-us-east-1-201902242628-dev may not be empty. Serverless: Getting all objects in S3 bucket...
Serverless Error ---------------------------------------
The specified bucket does not exist
$ sls remove S3 Remover: Make rmarable-test-bucket-#{AWS::AccountId}-us-east-1-201902242628-dev empty. Are you sure? [yes/no]: no S3 Remover: Remove cancelled: rmarable-test-bucket-#{AWS::AccountId}-us-east-1-201902242628-dev
Serverless Error ---------------------------------------
1 validation error detected: Value 'RDSManagementToolsStack-#{AWS::AccountId}-us-east-1-20190224v01-dev' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]|arn:[-a-zA-Z0-9:/._+]
Since expansion of Cloudformation pseudo parameters is more important than having to deal with clearing out a bucket before removing a serverless stack, I will have to disable this very useful plugin until this bug has been addressed (or explained if this is expected behavior).