Sam Hulick
04/08/2022, 6:24 PMthdxr
04/08/2022, 6:26 PMthdxr
04/08/2022, 6:26 PMSam Hulick
04/08/2022, 6:28 PMSam Hulick
04/08/2022, 9:01 PM[~] AWS::ApiGatewayV2::Route Route_PATCH_--account-info RoutePATCHaccountinfo2805F041
└─ [~] AuthorizerId
└─ [~] .Fn::ImportValue:
├─ [-] prod-microservices-api-base:ExportsOutputRefRestApiHttpUserPoolAuthorizerF0D1F4E162D79766
└─ [+] prod-microservices-api-base:ExportsOutputRefRestApiuserPoolAuthorizer4A82D71EEDB5D7AA
Sam Hulick
04/08/2022, 9:01 PMSam Hulick
04/08/2022, 9:03 PMSam Hulick
04/08/2022, 9:03 PMSam Hulick
04/08/2022, 9:46 PMdev-microservices-api-base | CREATE_IN_PROGRESS | AWS::ApiGatewayV2::Authorizer | RestApiuserPoolAuthorizer4A82D71E
dev-microservices-api-base | DELETE_FAILED | AWS::ApiGatewayV2::Authorizer | RestApiHttpUserPoolAuthorizerF0D1F4E1 | Cannot delete authorizer 'HttpUserPoolAuthorizer', is referenced in route: GET /admin/coupons (Service: AmazonApiGatewayV2; Status Code: 409; Error Code: ConflictException; Request ID: 7feabecf-fed7-4da5-bcad-8250cb1f0324; Proxy: null)
ughSam Hulick
04/08/2022, 9:46 PMthdxr
04/08/2022, 11:51 PMFrank
Frank
const authorizer = new HttpJwtAuthorizer("Authorizer", "<https://myorg.us.auth0.com>", {
jwtAudience: ["UsGRQJJz5sDfPQDs6bhQ9Oc3hNISuVif"],
});
this.api = new sst.Api(this, "Api", {
defaultAuthorizer: authorizer,
defaultAuthorizationType: sst.ApiAuthorizationType.JWT,
routes: {
...
},
});
and this in v1.0.0-beta.9:
new sst.Api(this, "Api", {
authorizers: {
Authorizer: {
type: "jwt",
jwt: {
issuer: "<https://myorg.us.auth0.com>",
audience: ["UsGRQJJz5sDfPQDs6bhQ9Oc3hNISuVif"],
}
},
},
defaults: {
authorizer: "Authorizer",
},
routes: {
...
}
});
They generate the same CloudFormation, and when exported, have the same export name.Frank
Sam Hulick
04/09/2022, 3:21 AMSam Hulick
04/09/2022, 3:22 AMSam Hulick
04/09/2022, 3:22 AMSam Hulick
04/09/2022, 3:42 AMError: section 'Outputs' already contains 'ExportsOutputRefRestApiHttpUserPoolAuthorizerF0D1F4E162D79766'
Sam Hulick
04/09/2022, 3:43 AMSam Hulick
04/09/2022, 3:54 AMChecking deploy status...
prod-microservices-api-base | UPDATE_IN_PROGRESS | AWS::CloudFormation::Stack | prod-microservices-api-base | User Initiated
prod-microservices-api-base | UPDATE_COMPLETE | AWS::CDK::Metadata | SSTMetadata
prod-microservices-api-base | CREATE_IN_PROGRESS | AWS::ApiGatewayV2::Authorizer | RestApiuserPoolAuthorizer4A82D71E
prod-microservices-api-base | CREATE_IN_PROGRESS | AWS::ApiGatewayV2::Authorizer | RestApiuserPoolAuthorizer4A82D71E | Resource creation Initiated
prod-microservices-api-base | CREATE_COMPLETE | AWS::ApiGatewayV2::Authorizer | RestApiuserPoolAuthorizer4A82D71E
prod-microservices-api-base | UPDATE_COMPLETE_CLEANUP_IN_PROGRESS | AWS::CloudFormation::Stack | prod-microservices-api-base
prod-microservices-api-base | DELETE_IN_PROGRESS | AWS::ApiGatewayV2::Authorizer | RestApiHttpUserPoolAuthorizerF0D1F4E1
prod-microservices-api-base | DELETE_FAILED | AWS::ApiGatewayV2::Authorizer | RestApiHttpUserPoolAuthorizerF0D1F4E1 | Cannot delete authorizer 'HttpUserPoolAuthorizer', is referenced in route: POST /admin/coupons/{couponCode}/assign (Service: AmazonApiGatewayV2; Status Code: 409; Error Code: ConflictException; Request ID: 28dbb8db-9e5d-4696-a14a-33c0fc6d91d6; Proxy: null)
POST /admin/coupons/{couponCode}/assign
isn’t even in this stack. how would it know about it? I can see api-base retained the old HttpUserPoolAuthorizer output. the description says Output added by SST b/c exported value still used in prod-microservices-api-misc, prod-microservices-api-media, prod-microservices-api-files, prod-microservices-api-users, prod-microservices-api-reels
Sam Hulick
04/09/2022, 4:00 AMFrank
Sam Hulick
04/09/2022, 4:04 AMauthorizers: [{type: 'user_pool', ... }, {type: 'iam', ...}]
Frank
Sam Hulick
04/09/2022, 4:05 AMSam Hulick
04/09/2022, 4:05 AMSam Hulick
04/09/2022, 4:07 AMFrank
Sam Hulick
04/09/2022, 4:07 AMSam Hulick
04/09/2022, 4:09 AMauthorizers: {
userPoolAuthorizer: {
type: 'user_pool',
userPool: {
id: props.cognitoAuth.cdk.userPool.userPoolId,
clientIds: [props.cognitoAuth.cdk.userPoolClient.userPoolClientId],
},
},
},
defaults: {
authorizer: 'userPoolAuthorizer',
},
0.69:
defaultAuthorizationType: sst.ApiAuthorizationType.JWT,
defaultAuthorizer: new HttpUserPoolAuthorizer(
'HttpUserPoolAuthorizer',
props.cognitoAuth.cognitoUserPool!,
{
userPoolClients: [props.cognitoAuth.cognitoUserPoolClient!],
}
),
Frank
Frank
Sam Hulick
04/09/2022, 4:10 AMauthorizers.HttpUserPoolAuthorizer
and it didn’t work.. so it needed a new name. oh, also I ran into a similar naming issue with an EventBus targetSam Hulick
04/09/2022, 4:11 AMSam Hulick
04/09/2022, 4:11 AMFrank
userPoolAuthorizer
were named HttpUserPoolAuthorizer
, the resource id would’ve been the same. And the export name would’ve been the same.Frank
Frank
Sam Hulick
04/10/2022, 7:02 PM