How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import { App, Stack } from "aws-cdk-lib";
    import { Bucket } from "aws-cdk-lib/aws-s3";
    
    const app = new App();
    const stack = new Stack(app, "TestStack");
    
    new Bucket(stack, "TestBucket");
    
    Docs
    0
  • import { Stack, App, aws_s3 as s3 } from "aws-cdk-lib";
    
    const app = new App();
    const stack = new Stack(app, "TestStack");
    
    new s3.Bucket(stack, "TestBucket");
    
    Docs
    0
  • import { App, Stack } from "aws-cdk-lib";
    import { Bucket } from "aws-cdk-lib/aws-s3";
    
    const app = new App();
    const stack = new Stack(app, "TestStack");
    
    new Bucket(stack, "TestBucket");
    
    Docs
    0
  • import { Stack, App, aws_s3 as s3 } from "aws-cdk-lib";
    
    const app = new App();
    const stack = new Stack(app, "TestStack");
    
    new s3.Bucket(stack, "TestBucket");
    
    Docs
    0
  • const stack = new Stack(app, "StackName");
    
    stack.templateOptions.description =
      "This will appear in the AWS console";
    stack.templateOptions.transforms = [
      "AWS::Serverless-2016-10-31",
    ];
    stack.templateOptions.metadata = {
      metadataKey: "MetadataValue",
    };
    
    Docs
    0
  • const stack = new Stack(app, "StackName", {
      terminationProtection: true,
    });
    
    Docs
    0
  • // Extracts the function name out of an AWS Lambda Function ARN
    const arnComponents = stack.parseArn(arn, ":");
    const functionName = arnComponents.resourceName;
    
    Docs
    0
  • import { Stack, App, aws_s3 as s3 } from "aws-cdk-lib";
    
    const app = new App();
    const stack = new Stack(app, "TestStack");
    
    new s3.Bucket(stack, "TestBucket");
    
    Docs
    0
  • class MyNestedStack extends cfn.NestedStack {
      constructor(
        scope: Construct,
        id: string,
        props?: cfn.NestedStackProps
      ) {
        super(scope, id, props);
    
        new s3.Bucket(this, "NestedBucket");
      }
    }
    
    class MyParentStack extends Stack {
      constructor(
        scope: Construct,
        id: string,
        props?: StackProps
      ) {
        super(scope, id, props);
    
        new MyNestedStack(this, "Nested1");
        new MyNestedStack(this, "Nested2");
      }
    }
    
    Docs
    0
  • const environmentParameter = new CfnParameter(
      this,
      "Environment"
    );
    const isProd = new CfnCondition(this, "IsProduction", {
      expression: Fn.conditionEquals(
        "Production",
        environmentParameter
      ),
    });
    
    // Configuration value that is a different string based on IsProduction
    const stage = Fn.conditionIf(
      isProd.logicalId,
      "Beta",
      "Prod"
    ).toString();
    
    // Make Bucket creation condition to IsProduction by accessing
    // and overriding the CloudFormation resource
    const bucket = new s3.Bucket(this, "Bucket");
    const cfnBucket = myBucket.node
      .defaultChild as s3.CfnBucket;
    cfnBucket.cfnOptions.condition = isProd;
    
    Docs
    0
  • const rawBucket = new s3.CfnBucket(this, "Bucket", {
      /* ... */
    });
    // -or-
    const rawBucketAlt = myBucket.node
      .defaultChild as s3.CfnBucket;
    
    // then
    rawBucket.cfnOptions.condition = new CfnCondition(
      this,
      "EnableBucket",
      {
        /* ... */
      }
    );
    rawBucket.cfnOptions.metadata = {
      metadataKey: "MetadataValue",
    };
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples