How to use the @aws-cdk/aws-s3-deployment.Source.asset function in @aws-cdk/aws-s3-deployment

To help you get started, we’ve selected a few @aws-cdk/aws-s3-deployment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudcomponents / cdk-components / packages / cdk-static-website / src / website-bucket.ts View on Github external
{
                cloudFrontOriginAccessIdentityConfig: {
                    comment: `CloudFront OriginAccessIdentity for ${bucket.bucketName}`,
                },
            },
        );

        bucket.grantRead(
            new CanonicalUserPrincipal(originId.attrS3CanonicalUserId),
        );

        if (!disableUpload) {
            const placeHolderSource = path.join(__dirname, '..', 'website');

            new BucketDeployment(this, 'WebsiteDeployment', {
                sources: [Source.asset(source || placeHolderSource)],
                destinationBucket: bucket,
                retainOnDelete: removalPolicy === RemovalPolicy.RETAIN,
            });
        }

        this.s3OriginConfig = {
            originAccessIdentityId: originId.ref,
            s3BucketSource: bucket,
        };
    }
}
github jeshan / scale-your-cloudformation / lib / cdk-stack.js View on Github external
],
            aliasConfiguration: {
                acmCertRef: cert.certificateArn,
                names: [domainName],
            },
        };
        let distribution = new CloudFrontWebDistribution(
            this,
            'WebSiteDistribution',
            distributionConfig,
        );

        const placeHolderSource = path.join(__dirname, '..', 'docs');

        new BucketDeployment(this, 'WebsiteDeployment', {
            sources: [Source.asset(placeHolderSource)],
            destinationBucket: websiteBucket,
            distribution,
            retainOnDelete: false,
        });

        new PipelineConstruct(this);
    }
}

@aws-cdk/aws-s3-deployment

Constructs for deploying contents to S3 buckets

Apache-2.0
Latest version published 11 months ago

Package Health Score

65 / 100
Full package analysis