Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove RANDOM_STRING to reduce SLS credits usage #643

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# APIGateway with export outputs
service: ${env:PLUGIN_IDENTIFIER}-apigateway-with-export-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-apigateway-with-export

frameworkVersion: "4.2.5"

Expand Down Expand Up @@ -27,23 +27,23 @@ resources:
Value:
Ref: ApiGatewayRestApi # Logical ID
Export:
Name: api-${self:provider.stage}-${env:RANDOM_STRING}-restApiId
Name: api-${self:provider.stage}-restApiId
RootResource:
Description: Main service's API Gateway Root Resource ID
Value:
Fn::GetAtt:
- ApiGatewayRestApi # Logical ID
- RootResourceId # Logical ID
Export:
Name: api-${self:provider.stage}-${env:RANDOM_STRING}-RootResourceId
Name: api-${self:provider.stage}-RootResourceId

plugins:
- serverless-domain-manager

custom:
customDomain:
stage: ${self:provider.stage}
domainName: ${env:PLUGIN_IDENTIFIER}-apigateway-with-export-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-apigateway-with-export.${env:TEST_DOMAIN}
autoDomain: true
basePath: hello-world
endpointType: REGIONAL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# APIGateway with import other CloudFormation stack outputs
service: ${env:PLUGIN_IDENTIFIER}-apigateway-with-import-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-apigateway-with-import

frameworkVersion: "4.2.5"

Expand All @@ -12,9 +12,9 @@ provider:
stage: test
apiGateway:
restApiId:
Fn::ImportValue: api-${self:provider.stage}-${env:RANDOM_STRING}-restApiId
Fn::ImportValue: api-${self:provider.stage}-restApiId
restApiRootResourceId:
Fn::ImportValue: api-${self:provider.stage}-${env:RANDOM_STRING}-RootResourceId
Fn::ImportValue: api-${self:provider.stage}-RootResourceId
functions:
helloWorld:
handler: handler.helloWorld
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/basic/basepath-mapping/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled and testing basepath mapping
service: ${env:PLUGIN_IDENTIFIER}-basepath-mapping-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-basepath-mapping

frameworkVersion: "4.2.5"

Expand Down Expand Up @@ -27,7 +27,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-basepath-mapping-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-basepath-mapping.${env:TEST_DOMAIN}
basePath: 'api'

package:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Creating a domain should be idempotent
service: ${env:PLUGIN_IDENTIFIER}-create-domain-idempotent-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-create-domain-idempotent

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-create-domain-idempotent-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-create-domain-idempotent.${env:TEST_DOMAIN}
basePath: ''

package:
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/basic/deploy-idempotent/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Deploying should be idempotent
service: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent.${env:TEST_DOMAIN}
basePath: ''

package:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Deploying should be idempotent for the same domain and different paths
service: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent2-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent2

frameworkVersion: "4.2.5"

Expand All @@ -25,11 +25,11 @@ custom:
- rest:
autoDomain: true
basePath: "path1"
domainName: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent2-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent2.${env:TEST_DOMAIN}
allowPathMatching: true
- rest:
basePath: "path2"
domainName: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent2-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-deploy-idempotent2.${env:TEST_DOMAIN}
allowPathMatching: true

package:
Expand Down
6 changes: 3 additions & 3 deletions test/integration-tests/basic/http-api-multiple/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service: ${env:PLUGIN_IDENTIFIER}-http-api-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-http-api

frameworkVersion: "4.2.5"

Expand Down Expand Up @@ -26,12 +26,12 @@ plugins:
custom:
customDomains:
- http:
domainName: ${env:PLUGIN_IDENTIFIER}-http-api-multi-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-http-api-multi.${env:TEST_DOMAIN}
basePath: ''
endpointType: REGIONAL
autoDomain: true
- http:
domainName: ${env:PLUGIN_IDENTIFIER}-http-api-milti2-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-http-api-milti2.${env:TEST_DOMAIN}
basePath: ''
endpointType: REGIONAL
autoDomain: true
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/basic/mutual-tls/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service: ${env:PLUGIN_IDENTIFIER}-mutual-tls-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-mutual-tls

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:

custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-mutual-tls-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-mutual-tls.${env:TEST_DOMAIN}
autoDomain: true
endpointType: REGIONAL
tlsTruststoreUri: ${env:TLS_TRUSTSTORE_URI}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled and testing basepath mapping
service: ${env:PLUGIN_IDENTIFIER}-null-basepath-mapping-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-null-basepath-mapping

frameworkVersion: "4.2.5"

Expand Down Expand Up @@ -27,7 +27,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-null-basepath-mapping-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-null-basepath-mapping.${env:TEST_DOMAIN}
basePath: ''

package:
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/basic/route53-profile/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Creating a domain should be idempotent
service: ${env:PLUGIN_IDENTIFIER}-route53-profile-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-route53-profile

frameworkVersion: "4.2.5"

Expand All @@ -23,7 +23,7 @@ plugins:

custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-route53-profile-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-route53-profile.${env:TEST_DOMAIN}
route53Profile: ${env:ROUTE53_PROFILE}

package:
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/deploy/auto-domain/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# create_domain should be run as part of deployment
service: ${env:PLUGIN_IDENTIFIER}-auto-domain-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-auto-domain

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-auto-domain-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-auto-domain.${env:TEST_DOMAIN}
basePath: ''
autoDomain: true
autoDomainWaitFor: 120
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled with custom basepath
service: ${env:PLUGIN_IDENTIFIER}-basepath-nested-stack-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-basepath-nested-stack

frameworkVersion: "4.2.5"

Expand All @@ -23,7 +23,7 @@ plugins:
- serverless-plugin-split-stacks
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-basepath-nested-stack-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-basepath-nested-stack.${env:TEST_DOMAIN}
basePath: 'api'
stage: ${self:provider.stage}
createRoute53Record: true
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/deploy/basepath/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled with custom basepath
service: ${env:PLUGIN_IDENTIFIER}-basepath-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-basepath

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-basepath-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-basepath.${env:TEST_DOMAIN}
basePath: 'api'

package:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled with default values
service: ${env:PLUGIN_IDENTIFIER}-custom-apigateway-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-custom-apigateway

frameworkVersion: "4.2.5"

Expand Down Expand Up @@ -27,7 +27,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-custom-apigateway-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-custom-apigateway.${env:TEST_DOMAIN}

package:
patterns:
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/deploy/default/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled with default values
service: ${env:PLUGIN_IDENTIFIER}-default-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-default

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-default-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-default.${env:TEST_DOMAIN}

package:
patterns:
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/deploy/http-api/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service: ${env:PLUGIN_IDENTIFIER}-http-api-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-http-api

frameworkVersion: "4.2.5"

Expand All @@ -20,7 +20,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-http-api-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-http-api.${env:TEST_DOMAIN}
endpointType: REGIONAL
apiType: http
# the stage should be set to $default for the base path (none)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled with regional endpoint, custom basePath
service: ${env:PLUGIN_IDENTIFIER}-regional-basepath-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-regional-basepath

frameworkVersion: "4.2.5"

Expand All @@ -23,7 +23,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-regional-basepath-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-regional-basepath.${env:TEST_DOMAIN}
basePath: 'api'
endpointType: REGIONAL

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled with regional endpoint, custom stage, empty basepath
service: ${env:PLUGIN_IDENTIFIER}-regional-stage-basepath-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-regional-stage-basepath

frameworkVersion: "4.2.5"

Expand All @@ -23,7 +23,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-regional-stage-basepath-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-regional-stage-basepath.${env:TEST_DOMAIN}
stage: test
basePath: ''
endpointType: REGIONAL
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/deploy/regional-tls-1-0/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Test regional domains with TLS 1.0
service: ${env:PLUGIN_IDENTIFIER}-regional-tls-1-0-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-regional-tls-1-0

frameworkVersion: "4.2.5"

Expand All @@ -24,7 +24,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-regional-tls-1-0-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-regional-tls-1-0.${env:TEST_DOMAIN}
securityPolicy: tls_1_0
endpointType: REGIONAL

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service: ${env:PLUGIN_IDENTIFIER}-route-53-latency-routing-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-route-53-latency-routing

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-route-53-latency-routing-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-route-53-latency-routing.${env:TEST_DOMAIN}
endpointType: REGIONAL
route53Params:
routingPolicy: latency
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service: ${env:PLUGIN_IDENTIFIER}-route-53-weighted-routing-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-route-53-weighted-routing

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-route-53-weighted-routing-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-route-53-weighted-routing.${env:TEST_DOMAIN}
endpointType: REGIONAL
route53Params:
routingPolicy: weighted
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service: ${env:PLUGIN_IDENTIFIER}-split-horizon-dns-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-split-horizon-dns

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-split-horizon-dns-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-split-horizon-dns.${env:TEST_DOMAIN}
endpointType: REGIONAL
splitHorizonDns: true
package:
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/deploy/stage-basepath/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enabled with custom stage and empty basepath
service: ${env:PLUGIN_IDENTIFIER}-stage-basepath-${env:RANDOM_STRING}
service: ${env:PLUGIN_IDENTIFIER}-stage-basepath

frameworkVersion: "4.2.5"

Expand All @@ -22,7 +22,7 @@ plugins:
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:PLUGIN_IDENTIFIER}-stage-basepath-${env:RANDOM_STRING}.${env:TEST_DOMAIN}
domainName: ${env:PLUGIN_IDENTIFIER}-stage-basepath.${env:TEST_DOMAIN}
stage: test
basePath: ''

Expand Down
Loading