How to use the @aws-cdk/core.CfnOutput 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 customink / activerecord-aurora-serverless-adapter / test / aurora-serverless / lib / aurora-serverless-stack.ts View on Github external
// SECRETS

    const secret = new CfnSecret(
      this,
      "Secret",
      secretProps(aurora, DB_CLUSTER_ID)
    );
    const secret2 = new CfnSecret(
      this,
      "Secret2",
      secretProps(aurora2, `${DB_CLUSTER_ID}2`)
    );
    secret.addDependsOn(aurora);
    secret2.addDependsOn(aurora2);
    new CfnOutput(this, "AASASecretArn", {
      value: secret.ref
    });
    new CfnOutput(this, "AASASecretArn2", {
      value: secret2.ref
    });

    // TEST USER

    const user = new User(this, "TestUser");
    const policy = new Policy(this, "TestUserPolicy", {
      statements: [
        new PolicyStatement({
          actions: ["rds-data:*"],
          resources: [
            `arn:aws:rds:${this.region}:${this.account}:cluster:${DB_CLUSTER_ID}*`,
            `arn:aws:rds:${this.region}:${this.account}:cluster:${DB_CLUSTER_ID}2*`
github aws / aws-cdk / packages / @aws-cdk / aws-ecs-patterns / lib / base / queue-processing-service-base.ts View on Github external
const enableLogging = props.enableLogging !== undefined ? props.enableLogging : true;
    this.logDriver = props.logDriver !== undefined
                        ? props.logDriver
                        : enableLogging
                            ? this.createAWSLogDriver(this.node.id)
                            : undefined;

    // Add the queue name to environment variables
    this.environment = { ...(props.environment || {}), QUEUE_NAME: this.sqsQueue.queueName };
    this.secrets = props.secrets;

    // Determine the desired task count (minimum) and maximum scaling capacity
    this.desiredCount = props.desiredTaskCount || 1;
    this.maxCapacity = props.maxScalingCapacity || (2 * this.desiredCount);

    new CfnOutput(this, 'SQSQueue', { value: this.sqsQueue.queueName });
    new CfnOutput(this, 'SQSQueueArn', { value: this.sqsQueue.queueArn });
  }
github aws / aws-cdk / packages / @aws-cdk / aws-eks-legacy / lib / cluster.ts View on Github external
this.clusterName = this.getResourceNameAttribute(resource.ref);
    this.clusterArn = this.getResourceArnAttribute(resource.attrArn, {
      service: 'eks',
      resource: 'cluster',
      resourceName: this.physicalName,
    });

    this.clusterEndpoint = resource.attrEndpoint;
    this.clusterCertificateAuthorityData = resource.attrCertificateAuthorityData;

    const updateConfigCommandPrefix = `aws eks update-kubeconfig --name ${this.clusterName}`;
    const getTokenCommandPrefix = `aws eks get-token --cluster-name ${this.clusterName}`;
    const commonCommandOptions = [ `--region ${stack.region}` ];

    if (props.outputClusterName) {
      new CfnOutput(this, 'ClusterName', { value: this.clusterName });
    }

    // we maintain a single manifest custom resource handler per cluster since
    // permissions and role are scoped. This will return `undefined` if kubectl
    // is not enabled for this cluster.
    this._k8sResourceHandler = this.createKubernetesResourceHandler();

    // map the IAM role to the `system:masters` group.
    if (props.mastersRole) {
      if (!this.kubectlEnabled) {
        throw new Error(`Cannot specify a "masters" role if kubectl is disabled`);
      }

      this.awsAuth.addMastersRole(props.mastersRole);

      if (props.outputMastersRoleArn) {
github nathanpeck / greeter-cdk / index.js View on Github external
});

    // Internet facing load balancer for the frontend services
    const externalLB = new elbv2.ApplicationLoadBalancer(this, 'external', {
      vpc: vpc,
      internetFacing: true
    });

    const externalListener = externalLB.addListener('PublicListener', { port: 80, open: true });

    externalListener.addTargets('greeter', {
      port: 80,
      targets: [greeterService]
    });

    this.internalDNS = new cdk.CfnOutput(this, 'InternalDNS', {
      exportName: 'greeter-app-internal',
      value: internalLB.loadBalancerDnsName
    });
    this.externalDNS = new cdk.CfnOutput(this, 'ExternalDNS', {
      exportName: 'greeter-app-external',
      value: externalLB.loadBalancerDnsName
    });
  }
}
github aws / aws-cdk / packages / @aws-cdk / aws-cloudformation / lib / nested-stack.ts View on Github external
private getCreateOutputForReference(reference: Reference) {
    const outputId = `${reference.target.node.uniqueId}${reference.displayName}`;
    let output = this.node.tryFindChild(outputId) as CfnOutput;
    if (!output) {
      output = new CfnOutput(this, outputId, { value: Token.asString(reference) });
    }

    return this.resource.getAtt(`Outputs.${output.logicalId}`);
  }
github humank / EventStormingWorkShop / deployment / coffeeshop-cdk / lib / coffee-shop-code-pipeline.ts View on Github external
}),
            ],
        });
        new cdk.CfnOutput(this, 'ServiceURL', {
            value: `http://${fargatesvc.loadBalancer.loadBalancerDnsName}`
        })

        new cdk.CfnOutput(this, 'StackId', {
            value: this.stackId
        })

        new cdk.CfnOutput(this, 'StackName', {
            value: this.stackName
        })

        new cdk.CfnOutput(this, 'CodeCommitRepoName', {
            value: codecommitRepo.repositoryName
        })

        let codeCommitHint = `
Create a "imagedefinitions.json" file and git add/push into CodeCommit repository "${CODECOMMIT_REPO_NAME}" with the following value:

[
  {
    "name": "defaultContainer",
    "imageUri": "${this.ecrRepository.repositoryUri}:latest"
  }
]
`
        new cdk.CfnOutput(this, 'Hint', {
            value: codeCommitHint
        })
github humank / EventStormingWorkShop / deployment / coffeeshop-cdk / lib / coffee-shop-code-pipeline.ts View on Github external
[
  {
    "name": "defaultContainer",
    "imageUri": "${this.ecrRepository.repositoryUri}:latest"
  }
]
`
        new cdk.CfnOutput(this, 'Hint', {
            value: codeCommitHint
        })

        new cdk.CfnOutput(this, 'CodeBuildProjectName', {
            value: CodeBuildProject.name
        })

        new cdk.CfnOutput(this, 'Bucket', { value: coffeeShopBucket.bucketName });

    }
}
github eladb / cdk-watchful / lib / watchful.ts View on Github external
constructor(scope: Construct, id: string, props: WatchfulProps = { }) {
    super(scope, id);

    if (props.alarmEmail) {
      this.alarmTopic = new sns.Topic(this, 'AlarmTopic', { displayName: 'Watchful Alarms' });
      this.alarmTopic.addSubscription(new sns_subscriptions.EmailSubscription(props.alarmEmail));
    }

    this.dash = new cloudwatch.Dashboard(this, 'Dashboard');

    new CfnOutput(this, 'WatchfulDashboard', {
      value: linkForDashboard(this.dash)
    });
  }
github humank / EventStormingWorkShop / deployment / coffeeshop-cdk / lib / coffee-shop-code-pipeline.ts View on Github external
new cdk.CfnOutput(this, 'CodeCommitRepoName', {
            value: codecommitRepo.repositoryName
        })

        let codeCommitHint = `
Create a "imagedefinitions.json" file and git add/push into CodeCommit repository "${CODECOMMIT_REPO_NAME}" with the following value:

[
  {
    "name": "defaultContainer",
    "imageUri": "${this.ecrRepository.repositoryUri}:latest"
  }
]
`
        new cdk.CfnOutput(this, 'Hint', {
            value: codeCommitHint
        })

        new cdk.CfnOutput(this, 'CodeBuildProjectName', {
            value: CodeBuildProject.name
        })

        new cdk.CfnOutput(this, 'Bucket', { value: coffeeShopBucket.bucketName });

    }
}