sparse-intern-71089
07/23/2018, 10:14 PMlemon-spoon-91807
07/24/2018, 1:22 AMlemon-spoon-91807
07/24/2018, 1:22 AMlemon-spoon-91807
07/24/2018, 1:22 AMlemon-spoon-91807
07/24/2018, 1:22 AMlemon-spoon-91807
07/24/2018, 1:23 AMand after pulumi has created/updated the API Gateway in the AWS cloud, the downloader would fetch the generated SDK
lemon-spoon-91807
07/24/2018, 1:23 AMlemon-spoon-91807
07/24/2018, 1:24 AMlemon-spoon-91807
07/24/2018, 1:24 AMlemon-spoon-91807
07/24/2018, 1:27 AMlemon-spoon-91807
07/24/2018, 1:27 AMlemon-spoon-91807
07/24/2018, 1:28 AMlemon-spoon-91807
07/24/2018, 1:30 AMlemon-spoon-91807
07/24/2018, 1:30 AMmodern-diamond-82589
07/24/2018, 2:37 AMlemon-spoon-91807
07/24/2018, 2:37 AMlemon-spoon-91807
07/24/2018, 2:37 AMlemon-spoon-91807
07/24/2018, 2:37 AMlemon-spoon-91807
07/24/2018, 2:38 AMmodern-diamond-82589
07/24/2018, 2:38 AMmodern-diamond-82589
07/24/2018, 2:39 AMtypescript
export class SdkDownloader extends pulumi.ComponentResource {
public constructor(name: string, args: SdkDownloader.Args, options?: pulumi.ResourceOptions) {
super('custom:SdkDownloader', name, args, options);
this.sdkFilePaths = this.downloadAndExtractSdkFiles(args);
this.registerOutputs({ sdkFilePaths: this.sdkFilePaths });
}
public readonly sdkFilePaths: pulumi.Output<string[]>;
private downloadAndExtractSdkFiles(args: SdkDownloader.Args): pulumi.Output<string[]> {
return pulumi.all([
args.destinationDirPath,
args.restApiId,
args.sdkType,
args.stageName
]).apply(([
destinationDirPath,
restApiId,
sdkType,
stageName
]) => {
const client = new AWS.APIGateway({
apiVersion: '2015-07-09',
region: new pulumi.Config('aws').require('region')
});
const getSdkRequest: AWS.APIGateway.GetSdkRequest = {
restApiId,
sdkType,
stageName
};
const sdkFilePathsPromise: Promise<string[]> = client.getSdk(getSdkRequest).promise()
.then((getSdkResponse: AWS.APIGateway.SdkResponse) => {
if (!Buffer.isBuffer(getSdkResponse.body)) {
throw new Error(`Unexpected AWS.APIGateway.getSdk() response body: ${getSdkResponse.body}`);
}
return extractZippedBufferToFiles(getSdkResponse.body, destinationDirPath);
});
return pulumi.output(sdkFilePathsPromise);
});
}
}
export namespace SdkDownloader {
export interface Args {
destinationDirPath: pulumi.Input<string>;
restApiId: pulumi.Input<string>;
sdkType: pulumi.Input<string>;
stageName: pulumi.Input<string>;
}
}
lemon-spoon-91807
07/24/2018, 2:39 AMlemon-spoon-91807
07/24/2018, 2:40 AMlemon-spoon-91807
07/24/2018, 2:41 AMlemon-spoon-91807
07/24/2018, 2:41 AMlemon-spoon-91807
07/24/2018, 2:41 AMlemon-spoon-91807
07/24/2018, 2:41 AMlemon-spoon-91807
07/24/2018, 2:41 AMlemon-spoon-91807
07/24/2018, 2:41 AMlemon-spoon-91807
07/24/2018, 2:43 AMmodern-diamond-82589
07/24/2018, 2:43 AMlemon-spoon-91807
07/24/2018, 2:44 AMlemon-spoon-91807
07/24/2018, 2:44 AMlemon-spoon-91807
07/24/2018, 2:45 AMmodern-diamond-82589
07/24/2018, 2:45 AMmodern-diamond-82589
07/24/2018, 2:45 AMlemon-spoon-91807
07/24/2018, 2:45 AMmodern-diamond-82589
07/24/2018, 2:46 AMlemon-spoon-91807
07/24/2018, 2:46 AMlemon-spoon-91807
07/24/2018, 2:47 AMlemon-spoon-91807
07/24/2018, 2:47 AMlemon-spoon-91807
07/24/2018, 2:47 AMlemon-spoon-91807
07/24/2018, 2:48 AMlemon-spoon-91807
07/24/2018, 2:48 AMlemon-spoon-91807
07/24/2018, 2:48 AMmodern-diamond-82589
07/24/2018, 2:48 AMmodern-diamond-82589
07/24/2018, 2:49 AMlemon-spoon-91807
07/24/2018, 2:50 AMmodern-diamond-82589
07/24/2018, 2:51 AMlemon-spoon-91807
07/24/2018, 2:51 AMlemon-spoon-91807
07/24/2018, 2:51 AMlemon-spoon-91807
07/24/2018, 2:51 AMlemon-spoon-91807
07/24/2018, 2:52 AMmodern-diamond-82589
07/24/2018, 2:53 AMmodern-diamond-82589
07/24/2018, 3:01 PMpulumi update
command. But it also runs during the update stage. That may have been the case before and I just didn't notice.lemon-spoon-91807
07/24/2018, 6:22 PMlemon-spoon-91807
07/24/2018, 6:22 PMlemon-spoon-91807
07/24/2018, 7:32 PMlemon-spoon-91807
07/24/2018, 7:32 PMmodern-diamond-82589
07/26/2018, 1:41 PMpulumi.Output<string>
originating from aws.apigateway.RestApi.id
and aws.apigateway.Stage.stageName
.modern-diamond-82589
07/26/2018, 1:47 PM