Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// tslint:disable-next-line:max-line-length
this.templateOptions.description = 'The CDK Toolkit Stack. It cas created by `cdk bootstrap` and manages resources necessary for managing your Cloud Applications with AWS CDK.';
const bucket = new s3.cloudformation.BucketResource(this, 'StagingBucket', {
accessControl: 'Private',
bucketEncryption: {
serverSideEncryptionConfiguration: [ { serverSideEncryptionByDefault: { sseAlgorithm: 'aws:kms' } } ]
}
});
this.bucketNameOutput = new cdk.Output(this, 'BucketName', {
description: 'The name of the S3 bucket owned by the CDK toolkit stack',
value: bucket.ref
});
this.bucketDomainNameOutput = new cdk.Output(this, 'BucketDomainName', {
description: 'The domain name of the S3 bucket owned by the CDK toolkit stack',
value: bucket.bucketDomainName
});
}
}
constructor(parent: cdk.App, name: string, props: cdk.StackProps) {
super(parent, name, props);
// tslint:disable-next-line:max-line-length
this.templateOptions.description = 'The CDK Toolkit Stack. It cas created by `cdk bootstrap` and manages resources necessary for managing your Cloud Applications with AWS CDK.';
const bucket = new s3.cloudformation.BucketResource(this, 'StagingBucket', {
accessControl: 'Private',
bucketEncryption: {
serverSideEncryptionConfiguration: [ { serverSideEncryptionByDefault: { sseAlgorithm: 'aws:kms' } } ]
}
});
this.bucketNameOutput = new cdk.Output(this, 'BucketName', {
description: 'The name of the S3 bucket owned by the CDK toolkit stack',
value: bucket.ref
});
this.bucketDomainNameOutput = new cdk.Output(this, 'BucketDomainName', {
description: 'The domain name of the S3 bucket owned by the CDK toolkit stack',
value: bucket.bucketDomainName
});
}
}
public export(): DatabaseClusterRefProps {
return {
port: new Output(this, 'Port', { value: this.clusterEndpoint.port, }).makeImportValue(),
securityGroupId: new Output(this, 'SecurityGroupId', { value: this.securityGroupId, }).makeImportValue(),
clusterIdentifier: new Output(this, 'ClusterIdentifier', { value: this.clusterIdentifier, }).makeImportValue(),
instanceIdentifiers: new StringListOutput(this, 'InstanceIdentifiers', { values: this.instanceIdentifiers }).makeImportValues(),
clusterEndpointAddress: new Output(this, 'ClusterEndpointAddress', { value: this.clusterEndpoint.hostname, }).makeImportValue(),
readerEndpointAddress: new Output(this, 'ReaderEndpointAddress', { value: this.readerEndpoint.hostname, }).makeImportValue(),
// tslint:disable-next-line:max-line-length
instanceEndpointAddresses: new StringListOutput(this, 'InstanceEndpointAddresses', { values: this.instanceEndpoints.map(e => e.hostname) }).makeImportValues(),
};
}
}
public export(): DatabaseClusterRefProps {
return {
port: new Output(this, 'Port', { value: this.clusterEndpoint.port, }).makeImportValue(),
securityGroupId: new Output(this, 'SecurityGroupId', { value: this.securityGroupId, }).makeImportValue(),
clusterIdentifier: new Output(this, 'ClusterIdentifier', { value: this.clusterIdentifier, }).makeImportValue(),
instanceIdentifiers: new StringListOutput(this, 'InstanceIdentifiers', { values: this.instanceIdentifiers }).makeImportValues(),
clusterEndpointAddress: new Output(this, 'ClusterEndpointAddress', { value: this.clusterEndpoint.hostname, }).makeImportValue(),
readerEndpointAddress: new Output(this, 'ReaderEndpointAddress', { value: this.readerEndpoint.hostname, }).makeImportValue(),
// tslint:disable-next-line:max-line-length
instanceEndpointAddresses: new StringListOutput(this, 'InstanceEndpointAddresses', { values: this.instanceEndpoints.map(e => e.hostname) }).makeImportValues(),
};
}
}
constructor(parent: App, name: string, props?: StackProps) {
super(parent, name, props);
const resource = new DemoResource(this, 'DemoResource', {
message: 'CustomResource says hello',
});
// Publish the custom resource output
new Output(this, 'ResponseMessage', {
description: 'The message that came back from the Custom Resource',
value: resource.response
});
}
}
public export(): DatabaseClusterRefProps {
return {
port: new Output(this, 'Port', { value: this.clusterEndpoint.port, }).makeImportValue(),
securityGroupId: new Output(this, 'SecurityGroupId', { value: this.securityGroupId, }).makeImportValue(),
clusterIdentifier: new Output(this, 'ClusterIdentifier', { value: this.clusterIdentifier, }).makeImportValue(),
instanceIdentifiers: new StringListOutput(this, 'InstanceIdentifiers', { values: this.instanceIdentifiers }).makeImportValues(),
clusterEndpointAddress: new Output(this, 'ClusterEndpointAddress', { value: this.clusterEndpoint.hostname, }).makeImportValue(),
readerEndpointAddress: new Output(this, 'ReaderEndpointAddress', { value: this.readerEndpoint.hostname, }).makeImportValue(),
// tslint:disable-next-line:max-line-length
instanceEndpointAddresses: new StringListOutput(this, 'InstanceEndpointAddresses', { values: this.instanceEndpoints.map(e => e.hostname) }).makeImportValues(),
};
}
}
public export(): QueueRefProps {
return {
queueArn: new Output(this, 'QueueArn', { value: this.queueArn }).makeImportValue(),
queueUrl: new Output(this, 'QueueUrl', { value: this.queueUrl }).makeImportValue(),
};
}
public export(): EventRuleRefProps {
return {
eventRuleArn: new Output(this, 'RuleArn', { value: this.ruleArn }).makeImportValue()
};
}
}
public export(): StreamRefProps {
const streamArn = new Output(this, 'StreamArn', { value: this.streamArn }).makeImportValue();
if (this.encryptionKey) {
return {
streamArn,
encryptionKey: this.encryptionKey.export()
};
} else {
return { streamArn };
}
}
public export(): TopicRefProps {
return {
topicArn: new Output(this, 'TopicArn', { value: this.topicArn }).makeImportValue(),
topicName: new Output(this, 'TopicName', { value: this.topicName }).makeImportValue(),
};
}