aws-cdk-lib#CfnOutput TypeScript Examples

The following examples show how to use aws-cdk-lib#CfnOutput. 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: certificate-stack.ts    From minwiz with BSD 2-Clause "Simplified" License 6 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    this.hostedZone = HostedZone.fromHostedZoneAttributes(
      this,
      "HostedZoneWithAttrs",
      {
        hostedZoneId,
        zoneName: website_domain,
      }
    );

    this.websiteCert = new DnsValidatedCertificate(this, "MinWizSSL", {
      domainName: website_domain,
      subjectAlternativeNames: [`www.${website_domain}`],
      hostedZone: this.hostedZone,
    });

    new CfnOutput(this, "WebsiteCertArn", {
      value: this.websiteCert.certificateArn,
    });
  }
Example #2
Source File: certificate.ts    From cdk-examples with MIT License 6 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);
    ///////////////////////////////
    // Part 1
    const hostedZone = HostedZone.fromHostedZoneAttributes(this, 'HostedZoneWithAttrs', {
        hostedZoneId,
        zoneName: website_domain
    })

    const websiteCert = new DnsValidatedCertificate(this, 'WebsiteSSL', {
        domainName: website_domain,
        hostedZone
    })

    new CfnOutput(this, 'WebsiteCertArn', {
        value: websiteCert.certificateArn
    })
    ///////////////////////////////
  }
Example #3
Source File: spa-deploy-construct.ts    From CDK-SPA-Deploy with MIT License 6 votes vote down vote up
/**
     * This will create an s3 deployment fronted by a cloudfront distribution
     * It will also setup error forwarding and unauth forwarding back to indexDoc
     */
    public createSiteWithCloudfront(config:SPADeployConfig): SPADeploymentWithCloudFront {
      const websiteBucket = this.getS3Bucket(config, true);
      const accessIdentity = new OriginAccessIdentity(this, 'OriginAccessIdentity', { comment: `${websiteBucket.bucketName}-access-identity` });
      const distribution = new CloudFrontWebDistribution(this, 'cloudfrontDistribution', this.getCFConfig(websiteBucket, config, accessIdentity));

      new s3deploy.BucketDeployment(this, 'BucketDeployment', {
        sources: [s3deploy.Source.asset(config.websiteFolder)],
        destinationBucket: websiteBucket,
        // Invalidate the cache for / and index.html when we deploy so that cloudfront serves latest site
        distribution,
        distributionPaths: ['/', `/${config.indexDoc}`],
        role: config.role,
      });

      new CfnOutput(this, 'cloudfront domain', {
        description: 'The domain of the website',
        value: distribution.distributionDomainName,
      });

      return { websiteBucket, distribution };
    }
Example #4
Source File: spa-deploy-construct.ts    From CDK-SPA-Deploy with MIT License 6 votes vote down vote up
/**
     * Basic setup needed for a non-ssl, non vanity url, non cached s3 website
     */
    public createBasicSite(config:SPADeployConfig): SPADeployment {
      const websiteBucket = this.getS3Bucket(config, false);

      new s3deploy.BucketDeployment(this, 'BucketDeployment', {
        sources: [s3deploy.Source.asset(config.websiteFolder)],
        role: config.role,
        destinationBucket: websiteBucket,
      });

      const cfnOutputConfig:any = {
        description: 'The url of the website',
        value: websiteBucket.bucketWebsiteUrl,
      };

      if (config.exportWebsiteUrlOutput === true) {
        if (typeof config.exportWebsiteUrlName === 'undefined' || config.exportWebsiteUrlName === '') {
          throw new Error('When Output URL as AWS Export property is true then the output name is required');
        }
        cfnOutputConfig.exportName = config.exportWebsiteUrlName;
      }

      let output = new CfnOutput(this, 'URL', cfnOutputConfig);
      //set the output name to be the same as the export name
      if(typeof config.exportWebsiteUrlName !== 'undefined' && config.exportWebsiteUrlName !== ''){
        output.overrideLogicalId(config.exportWebsiteUrlName);
      }

      return { websiteBucket };
    }
Example #5
Source File: Storage.ts    From lift with MIT License 6 votes vote down vote up
constructor(scope: CdkConstruct, id: string, configuration: Configuration, private provider: AwsProvider) {
        super(scope, id);

        const resolvedConfiguration = Object.assign({}, STORAGE_DEFAULTS, configuration);

        const encryptionOptions = {
            s3: BucketEncryption.S3_MANAGED,
            kms: BucketEncryption.KMS_MANAGED,
        };

        this.bucket = new Bucket(this, "Bucket", {
            encryption: encryptionOptions[resolvedConfiguration.encryption],
            versioned: true,
            blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
            enforceSSL: true,
            lifecycleRules: [
                {
                    transitions: [
                        {
                            storageClass: StorageClass.INTELLIGENT_TIERING,
                            transitionAfter: Duration.days(0),
                        },
                    ],
                },
                {
                    noncurrentVersionExpiration: Duration.days(30),
                },
            ],
        });

        this.bucketNameOutput = new CfnOutput(this, "BucketName", {
            value: this.bucket.bucketName,
        });
    }
Example #6
Source File: url-shortener.integ.ts    From cloudstructs with Apache License 2.0 6 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    const userPool = new cognito.UserPool(this, 'UserPool', {
      removalPolicy: RemovalPolicy.DESTROY,
    });

    const urlShortener = new UrlShortener(this, 'UrlShortener', {
      hostedZone: route53.HostedZone.fromHostedZoneAttributes(this, 'HostedZone', {
        hostedZoneId: 'ZKEU89CLZS8GH',
        zoneName: 'goldex.be',
      }),
      recordName: 'short',
      apiGatewayAuthorizer: new apigateway.CognitoUserPoolsAuthorizer(this, 'Authorizer', {
        cognitoUserPools: [userPool],
      }),
      corsAllowOrigins: ['*'],
    });

    const bucket = urlShortener.node.tryFindChild('Bucket') as s3.Bucket;
    bucket.applyRemovalPolicy(RemovalPolicy.DESTROY);

    new CfnOutput(this, 'ApiEndpoint', { value: urlShortener.apiEndpoint });
  }
Example #7
Source File: slack-app.integ.ts    From cloudstructs with Apache License 2.0 6 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    const app = new SlackApp(this, 'MyApp', {
      configurationTokenSecret: secretsmanager.Secret.fromSecretNameV2(this, 'Secret', 'slack-app-config-token'),
      manifest: SlackAppManifestDefinition.fromManifest({
        name: 'My App',
        description: 'A very cool Slack App deployed with CDK',
      }),
    });

    new CfnOutput(this, 'AppId', {
      value: app.appId,
    });
  }
Example #8
Source File: CloudFormation.ts    From lift with MIT License 6 votes vote down vote up
export async function getStackOutput(aws: AwsProvider, output: CfnOutput): Promise<string | undefined> {
    const outputId = Stack.of(output.stack).resolve(output.logicalId) as string;
    const stackName = aws.stackName;

    getUtils().log.debug(`Fetching output "${outputId}" in stack "${stackName}"`);

    let data: DescribeStacksOutput;
    try {
        data = await aws.request<DescribeStacksInput, DescribeStacksOutput>("CloudFormation", "describeStacks", {
            StackName: stackName,
        });
    } catch (e) {
        if (e instanceof Error && e.message === `Stack with id ${stackName} does not exist`) {
            getUtils().log.debug(e.message);

            return undefined;
        }

        throw e;
    }
    if (!data.Stacks || !data.Stacks[0].Outputs) {
        return undefined;
    }
    for (const item of data.Stacks[0].Outputs) {
        if (item.OutputKey === outputId) {
            return item.OutputValue;
        }
    }

    return undefined;
}
Example #9
Source File: ServerSideWebsite.ts    From lift with MIT License 5 votes vote down vote up
private readonly cnameOutput: CfnOutput;
Example #10
Source File: ServerSideWebsite.ts    From lift with MIT License 5 votes vote down vote up
private readonly distributionIdOutput: CfnOutput;
Example #11
Source File: Storage.ts    From lift with MIT License 5 votes vote down vote up
// a remplacer par StorageExtensionsKeys
    private readonly bucketNameOutput: CfnOutput;
Example #12
Source File: Webhook.ts    From lift with MIT License 5 votes vote down vote up
private readonly apiEndpointOutput: CfnOutput;
Example #13
Source File: Webhook.ts    From lift with MIT License 5 votes vote down vote up
private readonly endpointPathOutput: CfnOutput;
Example #14
Source File: StaticWebsiteAbstract.ts    From lift with MIT License 5 votes vote down vote up
private readonly bucketNameOutput: CfnOutput;
Example #15
Source File: StaticWebsiteAbstract.ts    From lift with MIT License 5 votes vote down vote up
private readonly domainOutput: CfnOutput;
Example #16
Source File: StaticWebsiteAbstract.ts    From lift with MIT License 5 votes vote down vote up
private readonly cnameOutput: CfnOutput;
Example #17
Source File: StaticWebsiteAbstract.ts    From lift with MIT License 5 votes vote down vote up
private readonly distributionIdOutput: CfnOutput;
Example #18
Source File: AwsProvider.ts    From lift with MIT License 5 votes vote down vote up
/**
     * Resolves the value of a CloudFormation stack output.
     */
    async getStackOutput(output: CfnOutput): Promise<string | undefined> {
        return getStackOutput(this, output);
    }
Example #19
Source File: integ.default.ts    From cdk-aurora-globaldatabase with Apache License 2.0 5 votes vote down vote up
new CfnOutput(stackM, 'password', { value: `${globaldbM.rdsPassword}` });
Example #20
Source File: cloudfront.ts    From minwiz with BSD 2-Clause "Simplified" License 5 votes vote down vote up
constructor(scope: Construct, id: string, props: CloudfrontStackProps) {
    super(scope, id, props);

    this.websiteBucket = new Bucket(this, "websiteBucket", {
      removalPolicy: RemovalPolicy.DESTROY,
      bucketName: website_domain,
      autoDeleteObjects: true,
    });

    new CfnOutput(this, "websiteBucketArn", {
      value: this.websiteBucket.bucketArn,
    });

    const cachePolicy = new CachePolicy(this, "MinWizPolicy", {
      defaultTtl: Duration.hours(24),
      minTtl: Duration.hours(24),
      maxTtl: Duration.hours(24),
      enableAcceptEncodingGzip: true,
      enableAcceptEncodingBrotli: true,
    });

    const distribution = new Distribution(this, "MinWizDistribution", {
      defaultBehavior: {
        origin: new S3Origin(this.websiteBucket),
        allowedMethods: AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
        cachePolicy,
        compress: true,
        viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
      },
      domainNames: [website_domain /*, `www.${website_domain}`*/],
      certificate: props.websiteCert,
      minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2019,
      defaultRootObject: "index.html",
      enableIpv6: true,
      enabled: true,
      httpVersion: HttpVersion.HTTP2,
      priceClass: PriceClass.PRICE_CLASS_ALL,
    });

    new ARecord(this, "aliasForCloudfront", {
      target: RecordTarget.fromAlias(new CloudFrontTarget(distribution)),
      zone: props.hostedZone,
      recordName: website_domain,
    });

    new HttpsRedirect(this, "wwwToNonWww", {
      recordNames: [`www.${website_domain}`],
      targetDomain: website_domain,
      zone: props.hostedZone,
    });
  }
Example #21
Source File: DatabaseDynamoDBSingleTable.ts    From lift with MIT License 5 votes vote down vote up
constructor(scope: CdkConstruct, id: string, configuration: Configuration, private provider: AwsProvider) {
        super(scope, id);

        const resolvedConfiguration = Object.assign({}, DATABASE_DEFAULTS, configuration);

        this.table = new Table(this, "Table", {
            partitionKey: { name: "PK", type: AttributeType.STRING },
            sortKey: { name: "SK", type: AttributeType.STRING },
            billingMode: BillingMode.PAY_PER_REQUEST,
            pointInTimeRecovery: true,
            timeToLiveAttribute: "TimeToLive",
            stream: StreamViewType.NEW_AND_OLD_IMAGES,
        });

        if (resolvedConfiguration.localSecondaryIndexes) {
            for (let localSecondaryIndex = 1; localSecondaryIndex <= 5; localSecondaryIndex++) {
                this.table.addLocalSecondaryIndex({
                    indexName: `LSI-${localSecondaryIndex}`,
                    sortKey: { name: `LSI-${localSecondaryIndex}-SK`, type: AttributeType.STRING },
                });
            }
        }

        if (resolvedConfiguration.gsiCount > 0) {
            for (
                let globalSecondaryIndex = 1;
                globalSecondaryIndex <= resolvedConfiguration.gsiCount;
                globalSecondaryIndex++
            ) {
                this.table.addGlobalSecondaryIndex({
                    indexName: `GSI-${globalSecondaryIndex}`,
                    partitionKey: { name: `GSI-${globalSecondaryIndex}-PK`, type: AttributeType.STRING },
                    sortKey: { name: `GSI-${globalSecondaryIndex}-SK`, type: AttributeType.STRING },
                });
            }
        }

        this.tableNameOutput = new CfnOutput(this, "TableName", {
            value: this.table.tableName,
        });
    }
Example #22
Source File: cloudfront-http-api-stack.ts    From cdk-examples with MIT License 5 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    // The code that defines your stack goes here
    ///////////////////////////////
    // Part 1
    const hostedZone = HostedZone.fromHostedZoneAttributes(this, 'hostedZoneWithAttributes', {
        hostedZoneId,
        zoneName: website_domain
    })
  
    const certificate = new DnsValidatedCertificate(this, 'ApiSSL', {
        domainName: website_domain,
        hostedZone
    })

    const api = new HttpApi(this, 'apiEndpoint', {
        apiName: 'exampleAPISameDomain',
    })
    
    new CfnOutput(this, 'apiID', {
        value: api.apiEndpoint
    })
    
    const signUpFn = new Function(this, 'signUpFn', {
        runtime: Runtime.NODEJS_16_X,
        code: Code.fromAsset(`${__dirname}/../lambda-fns/sign-up/deployment.zip`),
        handler: 'index.handler',
        memorySize: 512,
        architecture: Architecture.ARM_64
    })
    ///////////////////////////////
    
    ///////////////////////////////
    // Part 2
    api.addRoutes({
        path: '/api/sign-up',
        methods: [HttpMethod.POST],
        integration: new HttpLambdaIntegration('signUpFn', signUpFn)
    })
    
    const apiOriginPolicy = new OriginRequestPolicy(this, 'apiOriginPolicy', {
        cookieBehavior: OriginRequestCookieBehavior.all(),
        headerBehavior: OriginRequestHeaderBehavior.none(),
        queryStringBehavior: OriginRequestQueryStringBehavior.all()
    })
    
    const distribution = new Distribution(this, 'websiteAndAPIDistribution', {
        defaultBehavior: {
            origin: new HttpOrigin('origin-source-code.com'),
        },
        additionalBehaviors: {
            'api/*': {
                origin: new HttpOrigin(api.apiEndpoint.replace('https://', '')),
                allowedMethods: AllowedMethods.ALLOW_ALL,
                cachePolicy: CachePolicy.CACHING_DISABLED,
                compress: false,
                originRequestPolicy: apiOriginPolicy,
                viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS
            }
        },
        domainNames: [website_domain],
        certificate,
        minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
        enableIpv6: true,
        enabled: true,
        httpVersion: HttpVersion.HTTP2,
        priceClass: PriceClass.PRICE_CLASS_ALL
    })
    ///////////////////////////////

    ///////////////////////////////
    // Part 3
    new ARecord(this, 'AliasForCloudfront', {
        target: RecordTarget.fromAlias(new CloudFrontTarget(distribution)),
        zone: hostedZone,
        recordName: website_domain
    })
    ///////////////////////////////
  }
Example #23
Source File: http-api-stack.ts    From cdk-examples with MIT License 5 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    // The code that defines your stack goes here

    ///////////////////////////////
    // Part 1
    const hostedZone = HostedZone.fromHostedZoneAttributes(this, 'hostedZoneWithAttributes', {
      hostedZoneId,
      zoneName: website_domain
    })

    const apiCert = new DnsValidatedCertificate(this, 'ApiSSL', {
      domainName: api_domain,
      hostedZone
    })
    ///////////////////////////////

    ///////////////////////////////
    // Part 2
    const domain = new DomainName(this, 'api_domain', {
      domainName: api_domain,
      certificate: apiCert
    })

    const api = new HttpApi(this, 'apiEndpoint', {
      defaultDomainMapping: {
        domainName: domain
      },
      corsPreflight: {
        allowCredentials: true,
        allowHeaders: ['Content-Type'],
        allowMethods: [CorsHttpMethod.GET, CorsHttpMethod.POST, CorsHttpMethod.PUT, CorsHttpMethod.DELETE],
        allowOrigins: [
          'https://example.com'
        ]
      },
      apiName: 'exampleAPI',
      disableExecuteApiEndpoint: true
    })

    new CfnOutput(this, 'apiID', {
      value: api.httpApiId
    })

    const signUpFn = new Function(this, 'signUpFn', {
      runtime: Runtime.NODEJS_16_X,
      code: Code.fromAsset(`${__dirname}/../lambda-fns/sign-up/deployment.zip`),
      handler: 'index.handler',
      architecture: Architecture.ARM_64,
      memorySize: 512
    })
    ///////////////////////////////

    // const existingAPI = HttpApi.fromHttpApiAttributes(this, 'existingAPI', {
    //   apiEndpoint: api_domain,
    //   httpApiId: 'myApiId'
    // })
    
    ///////////////////////////////
    // Part 3
    new ARecord(this, 'apiAliasRecord', {
      zone: hostedZone,
      target: RecordTarget.fromAlias(new ApiGatewayv2DomainProperties(domain.regionalDomainName, domain.regionalHostedZoneId))
    })

    api.addRoutes({
      path: '/sign-up',
      methods: [HttpMethod.POST],
      integration: new HttpLambdaIntegration('signUpFn', signUpFn)
    })
    ///////////////////////////////
  }
Example #24
Source File: lambda-cost-stack.ts    From cdk-examples with MIT License 5 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    // The code that defines your stack goes here
    const powerValues = '128,256,512,1024,2048'

    new CfnApplication(this, 'powerTuner', {
      location: {
          applicationId: 'arn:aws:serverlessrepo:us-east-1:451282441545:applications/aws-lambda-power-tuning',
          semanticVersion: '4.2.0'
      },
      parameters: {
          "lambdaResource": "*",
          "PowerValues": powerValues
      },
      timeoutInMinutes: 15
    })

    const todoTable = new Table(this, 'todoTable', {
      partitionKey: {
        name: 'id',
        type: AttributeType.STRING
      },
      billingMode: BillingMode.PAY_PER_REQUEST,
      removalPolicy: RemovalPolicy.DESTROY
    })
    
    new CfnOutput(this, 'todoTableName', {
      value: todoTable.tableName
    })

    const getTodoFn = new NodejsFunction(this, 'getTodoFn', {
      runtime: Runtime.NODEJS_16_X,
      entry: `${__dirname}/../lambda-fns/get-todo/index.ts`,
      handler: 'getTodo',
      architecture: Architecture.ARM_64,
      environment: {
        TODO_TABLE_NAME: todoTableName
      }
    })

    todoTable.grantReadData(getTodoFn)

    const createTodoFn = new NodejsFunction(this, 'createTodoFn', {
      runtime: Runtime.NODEJS_16_X,
      entry: `${__dirname}/../lambda-fns/create-todo/index.ts`,
      handler: 'createTodo',
      architecture: Architecture.ARM_64,
      environment: {
        TODO_TABLE_NAME: todoTableName
      }
    })

    todoTable.grantReadWriteData(createTodoFn)

    const deleteTodoFn = new NodejsFunction(this, 'deleteTodoFn', {
      runtime: Runtime.NODEJS_16_X,
      entry: `${__dirname}/../lambda-fns/delete-todo/index.ts`,
      handler: 'deleteTodo',
      architecture: Architecture.ARM_64,
      environment: {
        TODO_TABLE_NAME: todoTableName
      }
    })

    todoTable.grantReadWriteData(deleteTodoFn)
  }
Example #25
Source File: lambda-layers-stack.ts    From cdk-examples with MIT License 5 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    // The code that defines your stack goes here

    const layer = new LayerVersion(this, 'uuidLayer', {
      code: Code.fromAsset(`${__dirname}/../lambda-fns/layer/deployment.zip`),
      compatibleRuntimes: [ Runtime.NODEJS_16_X],
      compatibleArchitectures: [Architecture.ARM_64],
      description: 'uuid package and discount for product'
    })

    layer.addPermission('layerPermission', {
      accountId: account
    })

    new CfnOutput(this, 'layerVersionArn', {
      value: layer.layerVersionArn
    })

    const latestLayer = LayerVersion.fromLayerVersionAttributes(this, 'latestLayer', {
      compatibleRuntimes: [Runtime.NODEJS_16_X],
      layerVersionArn
    })

    new Function(this, 'oneFn', { 
      runtime: Runtime.NODEJS_16_X,
      code: Code.fromAsset(`${__dirname}/../lambda-fns/one/deployment.zip`),
      handler: 'index.handler',
      architecture: Architecture.ARM_64,
      layers: [latestLayer]
    })

    new Function(this, 'twoFn', { 
      runtime: Runtime.NODEJS_16_X,
      code: Code.fromAsset(`${__dirname}/../lambda-fns/two/deployment.zip`),
      handler: 'index.handler',
      architecture: Architecture.ARM_64,
      layers: [latestLayer]
    })
  }
Example #26
Source File: s3cloudfront.ts    From cdk-examples with MIT License 5 votes vote down vote up
constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    ///////////////////////////////
    // Part 2
    const bucket = new Bucket(this, 'websiteBucket', {
        removalPolicy: RemovalPolicy.DESTROY,
        bucketName: website_domain,
        autoDeleteObjects: true
    })
    
    new CfnOutput(this, 'websiteBucketArn', {
        value: bucket.bucketArn
    })
    ///////////////////////////////

    ///////////////////////////////
    // Part 3
    const certificate = Certificate.fromCertificateArn(this, 'websiteCert', websiteCertArn)
    
    const cachePolicy = new CachePolicy(this, 'examplePolicy', {
        defaultTtl: Duration.hours(24),
        minTtl: Duration.hours(24),
        maxTtl: Duration.hours(24),
        enableAcceptEncodingGzip: true,
        enableAcceptEncodingBrotli: true
    })

    const distribution = new Distribution(this, 'exampleDistribution', {
        defaultBehavior: {
            origin: new S3Origin(bucket),
            allowedMethods: AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
            cachePolicy,
            compress: true,
            viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS
        },
        domainNames: [website_domain],
        certificate,
        minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
        defaultRootObject: 'index.html',
        enableIpv6: true,
        enabled: true,
        httpVersion: HttpVersion.HTTP2,
        priceClass: PriceClass.PRICE_CLASS_ALL
    })
    ///////////////////////////////

    ///////////////////////////////
    // Part 4
    const hostedZone = HostedZone.fromHostedZoneAttributes(this, 'hostedZoneWithAttrs', {
        hostedZoneId,
        zoneName: website_domain
    })
    
    new ARecord(this, 'aliasForCloudfront', {
        target: RecordTarget.fromAlias(new CloudFrontTarget(distribution)),
        zone: hostedZone,
        recordName: website_domain
    })
    ///////////////////////////////

    ///////////////////////////////
    // Part 5
    new HttpsRedirect(this, 'wwwToNonWww', {
        recordNames: ['www.example.com'],
        targetDomain: website_domain,
        zone:hostedZone
    })

    const repo = new Repository(this, 'reactSourceCode', {
        repositoryName: 'example',
        description: `react repo for ${website_domain}`
    })

    new CfnOutput(this, 'reactRepoArn', {
        value: repo.repositoryArn
    })
    ///////////////////////////////
  }
Example #27
Source File: ServerSideWebsite.ts    From lift with MIT License 5 votes vote down vote up
private readonly domainOutput: CfnOutput;
Example #28
Source File: DatabaseDynamoDBSingleTable.ts    From lift with MIT License 5 votes vote down vote up
private readonly tableNameOutput: CfnOutput;
Example #29
Source File: Queue.ts    From lift with MIT License 5 votes vote down vote up
private readonly queueArnOutput: CfnOutput;