arda
10/18/2021, 3:49 PM.env
for testing?arda
10/18/2021, 3:50 PMserverless-export-env
pluginthdxr
10/18/2021, 3:51 PMSSM
. Then my application can load it, whether it's a lambda or a test running locallyarda
10/18/2021, 3:52 PMSSM
?thdxr
10/18/2021, 3:53 PMarda
10/18/2021, 3:53 PMSSM
?thdxr
10/18/2021, 3:54 PMnew ssm.StringParameter(this, "ParamUserPoolId", {
parameterName: "/" + this.stage + "/ship/USER_POOL_ID",
stringValue: pool.userPoolId,
})
new ssm.StringParameter(this, "ParamUserPoolClientId", {
parameterName: "/" + this.stage + "/ship/USER_POOL_CLIENT_ID",
stringValue: client.userPoolClientId,
})
Example from my stack codethdxr
10/18/2021, 3:54 PMarda
10/18/2021, 3:54 PMthdxr
10/18/2021, 3:55 PMarda
10/18/2021, 3:57 PMarda
10/18/2021, 3:59 PMthdxr
10/18/2021, 3:59 PMthdxr
10/18/2021, 3:59 PMarda
10/18/2021, 4:01 PMthdxr
10/18/2021, 4:06 PMSSM_PATH=whatever jest
Seth Geoghegan
10/18/2021, 4:13 PMarda
10/19/2021, 2:34 PMthdxr
10/19/2021, 2:52 PMthdxr
10/19/2021, 2:52 PMarda
10/19/2021, 2:56 PMconst result = await ssm.getParametersByPath("/dev/meet-and-donate-app");
and the actual call is:
getParametersByPath: async (path) =>
SSM.getParametersByPath({
Path: path,
Recursive: true,
}).promise(),
but I am hitting this error:
● Test Stack
ConfigError: Missing region in config
7 | Path: path,
8 | Recursive: true,
> 9 | }).promise(),
| ^
10 | };
also I am wondering how come our tests can have access to SSM or DynamoDB directly?thdxr
10/19/2021, 3:03 PMAWS_PROFILE
as an env variable so it uses your local config but also AWS_SDK_LOAD_CONFIG=1
thdxr
10/19/2021, 3:03 PMarda
10/19/2021, 5:43 PMthdxr
10/19/2021, 5:45 PMarda
10/19/2021, 6:35 PMAWS_REGION=‘us-east-1’ SSM_PATH=‘/dev/meet-and-donate-app’ sst test
😇thdxr
10/19/2021, 6:35 PMarda
10/19/2021, 6:36 PMthdxr
10/19/2021, 6:37 PM~/.aws
configarda
10/19/2021, 6:41 PMAWS_SDK_LOAD_CONFIG=true
though. https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html#setting-region-config-filethdxr
10/19/2021, 6:43 PM~/.aws
configarda
10/19/2021, 6:44 PM~/.aws/config
but i still have to pass in ``AWS_SDK_LOAD_CONFIG=true` to my test script in order to have the region loadedthdxr
10/19/2021, 6:48 PMjest
directly not through sst so I was thinking there's nothing sst can do to make that work. I just have it in my package.jsonarda
10/20/2021, 5:06 PMthdxr
10/20/2021, 5:13 PM