How to use the @aws-cdk/core.Output function in @aws-cdk/core

To help you get started, we’ve selected a few @aws-cdk/core 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 aws / aws-cdk / packages / aws-cdk / lib / api / util / toolkit-stack.ts View on Github external
// 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
        });
    }
}
github aws / aws-cdk / packages / aws-cdk / lib / api / util / toolkit-stack.ts View on Github external
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
        });
    }
}
github aws / aws-cdk / packages / @aws-cdk / rds / lib / cluster-ref.ts View on Github external
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(),
        };
    }
}
github aws / aws-cdk / packages / @aws-cdk / rds / lib / cluster-ref.ts View on Github external
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(),
        };
    }
}
github aws / aws-cdk / packages / @aws-cdk / custom-resources / example / index.ts View on Github external
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
        });
    }
}
github aws / aws-cdk / packages / @aws-cdk / rds / lib / cluster-ref.ts View on Github external
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(),
        };
    }
}
github aws / aws-cdk / packages / @aws-cdk / sqs / lib / queue-ref.ts View on Github external
public export(): QueueRefProps {
        return {
            queueArn: new Output(this, 'QueueArn', { value: this.queueArn }).makeImportValue(),
            queueUrl: new Output(this, 'QueueUrl', { value: this.queueUrl }).makeImportValue(),
        };
    }
github aws / aws-cdk / packages / @aws-cdk / events / lib / rule-ref.ts View on Github external
public export(): EventRuleRefProps {
        return {
            eventRuleArn: new Output(this, 'RuleArn', { value: this.ruleArn }).makeImportValue()
        };
    }
}
github aws / aws-cdk / packages / @aws-cdk / kinesis / lib / stream.ts View on Github external
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 };
        }
    }
github aws / aws-cdk / packages / @aws-cdk / sns / lib / topic-ref.ts View on Github external
public export(): TopicRefProps {
        return {
            topicArn: new Output(this, 'TopicArn', { value: this.topicArn }).makeImportValue(),
            topicName: new Output(this, 'TopicName', { value: this.topicName }).makeImportValue(),
        };
    }