Skip to content

Commit

Permalink
Correctly support apiKeySource in classic provider
Browse files Browse the repository at this point in the history
We were previously passing apiKeySource only via Swagger.  Even though AWS API Gateway does include the API key source in the swagger on output, it apparently does not read it from the swagger on updates.

However, it does support passing it outside of the Swagger, so we just pass this along directly to the RestAPI constructor is specified.

We could in principle *stop* sending it in the Swagger as well (since I don't think it's read from there at all), but I am avoiding changing that in case it has other subtle impacts on behaviour.
  • Loading branch information
lukehoban committed Nov 21, 2023
1 parent 6f8e292 commit 6df3adc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions awsx-classic/apigateway/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ export function createAPI(parent: pulumi.Resource, name: string, args: APIArgs,
name: ifUndefined(restApiArgs.name, title),
binaryMediaTypes: ifUndefined(restApiArgs.binaryMediaTypes, ["*/*"]),
body: swaggerString,
// We pass this in directly, because setting it in the Swagger doesn't cause
// it to take affect, it must be passed directly to the RestAPI constructor as well.
apiKeySource: args.apiKeySource,
}, { parent });

if (restApiArgs.policy) {
Expand Down
3 changes: 3 additions & 0 deletions sdk/nodejs/classic/apigateway/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ export function createAPI(parent: pulumi.Resource, name: string, args: APIArgs,
name: ifUndefined(restApiArgs.name, title),
binaryMediaTypes: ifUndefined(restApiArgs.binaryMediaTypes, ["*/*"]),
body: swaggerString,
// We pass this in directly, because setting it in the Swagger doesn't cause
// it to take affect, it must be passed directly to the RestAPI constructor as well.
apiKeySource: args.apiKeySource,
}, { parent });

if (restApiArgs.policy) {
Expand Down

0 comments on commit 6df3adc

Please sign in to comment.