aws-sdk#CloudFormation TypeScript Examples

The following examples show how to use aws-sdk#CloudFormation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts    From ServerlessPlugin-SSMPublish with MIT License 6 votes vote down vote up
private static prettifyCFOutput(stackResult: CloudFormation.DescribeStacksOutput): SSMParamWithValue[] {
    if (!stackResult.Stacks) return [];

    const stackOutput = stackResult.Stacks[0].Outputs;

    if (!stackOutput) return [];

    const formattedParams = stackOutput
      // ensure output matches our formatting
      .map((output) => ({
      path: output.OutputKey || '',
      value: output.OutputValue || '',
      description: output.Description,
    }));

    return formattedParams || [];
  }
Example #2
Source File: index.ts    From ServerlessPlugin-SSMPublish with MIT License 6 votes vote down vote up
private async fetchCFOutput(): Promise<CloudFormation.DescribeStacksOutput> {
    return this.serverless.getProvider('aws').request(
      'CloudFormation',
      'describeStacks',
      { StackName: this.stackName },
      this.serverless.getProvider('aws').getStage(),
      this.serverless.getProvider('aws').getRegion(),
    );
  }
Example #3
Source File: stackutils.ts    From sourcestack with MIT License 6 votes vote down vote up
export async function findStack(stackName: string) {
    checkEnv();
    let stacks = await new CloudFormation().describeStacks().promise();
    return stacks.Stacks?.find(s => s.StackName == stackName);
}
Example #4
Source File: sdk-calls.ts    From amplify-codegen with Apache License 2.0 5 votes vote down vote up
describeCloudFormationStack = async (stackName: string, region: string, profileConfig?: any) => {
  const service = profileConfig ? new CloudFormation(profileConfig) : new CloudFormation({ region });
  return (await service.describeStacks({ StackName: stackName }).promise()).Stacks.find(
    stack => stack.StackName === stackName || stack.StackId === stackName,
  );
}
Example #5
Source File: extract-template-hashes.lambda.ts    From cloudstructs with Apache License 2.0 5 votes vote down vote up
cloudFormation = new CloudFormation()
Example #6
Source File: get-stack-names.lambda.ts    From cloudstructs with Apache License 2.0 5 votes vote down vote up
cloudFormation = new CloudFormation()