Created
October 24, 2023 11:45
-
-
Save skorfmann/2370ba39cd8680435253d2126051fc6e to your computer and use it in GitHub Desktop.
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
/** | |
* Post-synthesis function to configure AWS provider for LocalStack | |
*/ | |
exports.postSynth = function(config) { | |
const endpoint = "http://localhost:4566"; | |
const services = [ | |
"apigateway", "apigatewayv2", "cloudformation", "cloudwatch", "dynamodb", "ec2", "es", | |
"elasticache", "firehose", "iam", "kinesis", "lambda", "rds", "redshift", "route53", | |
"secretsmanager", "ses", "sns", "sqs", "ssm", "stepfunctions", "sts" | |
]; | |
let endpoints = {}; | |
services.forEach(service => { | |
endpoints[service] = endpoint; | |
}); | |
endpoints["s3"] = "http://s3.localhost.localstack.cloud:4566"; | |
config.provider.aws = { | |
access_key: "test", | |
secret_key: "test", | |
region: "us-east-1", | |
s3_use_path_style: false, | |
skip_credentials_validation: true, | |
skip_metadata_api_check: true, | |
skip_requesting_account_id: true, | |
endpoints | |
} | |
return config; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment