aws-cdk-lib#SecretValue TypeScript Examples

The following examples show how to use aws-cdk-lib#SecretValue. 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: slack-textract.test.ts    From cloudstructs with Apache License 2.0 6 votes vote down vote up
test('SlackEvents', () => {
  new SlackTextract(stack, 'SlackTextract', {
    signingSecret: SecretValue.secretsManager('my-slack-app', { jsonField: 'signingSecret' }),
    appId: SecretValue.secretsManager('my-slack-app', { jsonField: 'appId' }).toString(),
    botToken: SecretValue.secretsManager('my-slack-app', { jsonField: 'botToken' }),
  });

  expect(Template.fromStack(stack).toJSON()).toMatchSnapshot();
});
Example #2
Source File: slack-events.test.ts    From cloudstructs with Apache License 2.0 5 votes vote down vote up
test('SlackEvents', () => {
  new SlackEvents(stack, 'SlackEvents', {
    signingSecret: SecretValue.secretsManager('my-slack-app'),
  });

  expect(Template.fromStack(stack).toJSON()).toMatchSnapshot();
});
Example #3
Source File: pipeline-stack.ts    From minwiz with BSD 2-Clause "Simplified" License 5 votes vote down vote up
constructor(app: App, id: string, props: PipelineStackProps) {
    super(app, id, props);

    const siteBuild = new PipelineProject(this, "MinWizBuild", {
      description: "minwiz.com site build",
      buildSpec: BuildSpec.fromObject({
        version: "0.2",
        phases: {
          install: {
            commands: ["npm ci"],
          },
          build: {
            commands: "npm run build",
          },
        },
        artifacts: {
          "base-directory": "dist",
          files: ["**/*"],
        },
      }),
      environment: {
        buildImage: LinuxBuildImage.STANDARD_5_0,
        computeType: ComputeType.SMALL,
      },
    });

    const siteBuildOutput = new Artifact("SiteBuildOutput");

    const sourceOutput = new Artifact("SrcOutput");

    const artifactBucket = new Bucket(this, "MinWizPipelineArtifacts", {
      removalPolicy: RemovalPolicy.DESTROY,
      encryption: BucketEncryption.S3_MANAGED,
      blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
      autoDeleteObjects: true,
    });

    new Pipeline(this, "MinWiz", {
      restartExecutionOnUpdate: true,
      artifactBucket,
      stages: [
        {
          stageName: "Source",
          actions: [
            new GitHubSourceAction({
              actionName: "Checkout",
              output: sourceOutput,
              owner: "zeplia",
              repo: "minwiz",
              oauthToken: SecretValue.plainText(props.githubToken),
              trigger: GitHubTrigger.WEBHOOK,
            }),
          ],
        },
        {
          stageName: "Build",
          actions: [
            new CodeBuildAction({
              actionName: "Site_Build",
              project: siteBuild,
              input: sourceOutput,
              outputs: [siteBuildOutput],
            }),
          ],
        },
        {
          stageName: "Deploy",
          actions: [
            new S3DeployAction({
              actionName: "DeployStaticSite",
              input: siteBuildOutput,
              bucket: props.websiteBucket,
            }),
          ],
        },
      ],
    });
  }