Skip to content

Latest commit

 

History

History
962 lines (588 loc) · 33.9 KB

File metadata and controls

962 lines (588 loc) · 33.9 KB

API Reference

Constructs

CostReport

Represents a Cost Report construct in AWS CDK.

This class creates an AWS Cost and Usage Report, stored in an S3 bucket, and configures the necessary permissions.

Example

const report = new CostReport(stack, 'MyReport', {
  costReportName: 'business-report',
  reportGranularity: ReportGranularity.MONTHLY,
  format: CurFormat.PARQUET
});

Initializers

import { aws_cur } from '@open-constructs/aws-cdk'

new aws_cur.CostReport(scope: Construct, id: string, props: CostReportProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props @open-constructs/aws-cdk.aws_cur.CostReportProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired
  • Type: @open-constructs/aws-cdk.aws_cur.CostReportProps

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { aws_cur } from '@open-constructs/aws-cdk'

aws_cur.CostReport.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
reportBucket aws-cdk-lib.aws_s3.IBucket The S3 bucket that stores the cost report.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


reportBucketRequired
public readonly reportBucket: IBucket;
  • Type: aws-cdk-lib.aws_s3.IBucket

The S3 bucket that stores the cost report.


InstanceConnectEndpoint

  • Implements: @open-constructs/aws-cdk.aws_ec2.IInstanceConnectEndpoint

Represents an EC2 Instance Connect Endpoint construct in AWS CDK.

Example

declare const securityGroups: aws_ec2.ISecurityGroup[];
declare const vpc: aws_ec2.IVpc;

const instanceConnectEndpoint = new InstanceConnectEndpoint(
  stack,
  'InstanceConnectEndpoint',
  {
    clientToken: 'my-client-token',
    preserveClientIp: true,
    securityGroups,
    vpc,
  },
);

Initializers

import { aws_ec2 } from '@open-constructs/aws-cdk'

new aws_ec2.InstanceConnectEndpoint(scope: Construct, id: string, props: InstanceConnectEndpointProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props @open-constructs/aws-cdk.aws_ec2.InstanceConnectEndpointProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired
  • Type: @open-constructs/aws-cdk.aws_ec2.InstanceConnectEndpointProps

Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

Static Functions

Name Description
isConstruct Checks if x is a construct.
isOwnedResource Returns true if the construct was created by CDK, and false otherwise.
isResource Check whether the given construct is a Resource.
fromInstanceConnectEndpointAttributes Import an existing endpoint to the stack from its attributes.

isConstruct
import { aws_ec2 } from '@open-constructs/aws-cdk'

aws_ec2.InstanceConnectEndpoint.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isOwnedResource
import { aws_ec2 } from '@open-constructs/aws-cdk'

aws_ec2.InstanceConnectEndpoint.isOwnedResource(construct: IConstruct)

Returns true if the construct was created by CDK, and false otherwise.

constructRequired
  • Type: constructs.IConstruct

isResource
import { aws_ec2 } from '@open-constructs/aws-cdk'

aws_ec2.InstanceConnectEndpoint.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

fromInstanceConnectEndpointAttributes
import { aws_ec2 } from '@open-constructs/aws-cdk'

aws_ec2.InstanceConnectEndpoint.fromInstanceConnectEndpointAttributes(scope: Construct, id: string, attrs: InstanceConnectEndpointAttributes)

Import an existing endpoint to the stack from its attributes.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

attrsRequired
  • Type: @open-constructs/aws-cdk.aws_ec2.InstanceConnectEndpointAttributes

Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
connections aws-cdk-lib.aws_ec2.Connections The connection object associated with the EC2 Instance Connect Endpoint.
instanceConnectEndpointId string The ID of the EC2 Instance Connect Endpoint.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


connectionsRequired
public readonly connections: Connections;
  • Type: aws-cdk-lib.aws_ec2.Connections

The connection object associated with the EC2 Instance Connect Endpoint.


instanceConnectEndpointIdRequired
public readonly instanceConnectEndpointId: string;
  • Type: string

The ID of the EC2 Instance Connect Endpoint.


Structs

CostReportProps

Properties for defining a Cost and Usage Report.

Initializer

import { aws_cur } from '@open-constructs/aws-cdk'

const costReportProps: aws_cur.CostReportProps = { ... }

Properties

Name Type Description
bucket aws-cdk-lib.aws_s3.IBucket The bucket to place the cost report into.
costReportName string The name of the cost report.
format @open-constructs/aws-cdk.aws_cur.CurFormat The format to use for the cost and usage report.
reportGranularity @open-constructs/aws-cdk.aws_cur.ReportGranularity The granularity of the line items in the report.

bucketOptional
public readonly bucket: IBucket;
  • Type: aws-cdk-lib.aws_s3.IBucket
  • Default: a new bucket will be created.

The bucket to place the cost report into.

If non is provided, a new bucket will be created.


costReportNameOptional
public readonly costReportName: string;
  • Type: string
  • Default: 'default-cur'

The name of the cost report.


formatOptional
public readonly format: CurFormat;
  • Type: @open-constructs/aws-cdk.aws_cur.CurFormat
  • Default: TEXT_OR_CSV

The format to use for the cost and usage report.


reportGranularityOptional
public readonly reportGranularity: ReportGranularity;
  • Type: @open-constructs/aws-cdk.aws_cur.ReportGranularity
  • Default: HOURLY

The granularity of the line items in the report.


InstanceConnectEndpointAttributes

Attributes for importing an EC2 Instance Connect Endpoint.

Initializer

import { aws_ec2 } from '@open-constructs/aws-cdk'

const instanceConnectEndpointAttributes: aws_ec2.InstanceConnectEndpointAttributes = { ... }

Properties

Name Type Description
instanceConnectEndpointId string The ID of the EC2 Instance Connect Endpoint.
securityGroups aws-cdk-lib.aws_ec2.ISecurityGroup[] The security groups associated with the EC2 Instance Connect Endpoint.

instanceConnectEndpointIdRequired
public readonly instanceConnectEndpointId: string;
  • Type: string

The ID of the EC2 Instance Connect Endpoint.


securityGroupsRequired
public readonly securityGroups: ISecurityGroup[];
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]

The security groups associated with the EC2 Instance Connect Endpoint.


InstanceConnectEndpointProps

Properties for defining an EC2 Instance Connect Endpoint.

Initializer

import { aws_ec2 } from '@open-constructs/aws-cdk'

const instanceConnectEndpointProps: aws_ec2.InstanceConnectEndpointProps = { ... }

Properties

Name Type Description
vpc aws-cdk-lib.aws_ec2.IVpc The VPC in which the EC2 Instance Connect Endpoint is created.
clientToken string Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
preserveClientIp boolean Indicates whether your client's IP address is preserved as the source.
securityGroups aws-cdk-lib.aws_ec2.ISecurityGroup[] The security groups to associate with the EC2 Instance Connect Endpoint.

vpcRequired
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc

The VPC in which the EC2 Instance Connect Endpoint is created.


clientTokenOptional
public readonly clientToken: string;
  • Type: string

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instanceconnectendpoint.html#cfn-ec2-instanceconnectendpoint-clienttoken


preserveClientIpOptional
public readonly preserveClientIp: boolean;
  • Type: boolean
  • Default: true

Indicates whether your client's IP address is preserved as the source.

https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instanceconnectendpoint.html#cfn-ec2-instanceconnectendpoint-preserveclientip


securityGroupsOptional
public readonly securityGroups: ISecurityGroup[];
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]
  • Default: a new security group is created

The security groups to associate with the EC2 Instance Connect Endpoint.


Classes

CurFormat

Enum for the possible formats of a cost report.

Initializers

import { aws_cur } from '@open-constructs/aws-cdk'

new aws_cur.CurFormat(compression: string, format: string)
Name Type Description
compression string No description.
format string No description.

compressionRequired
  • Type: string

formatRequired
  • Type: string

Static Functions

Name Description
for Returns a CurFormat instance for the given compression and format string values.

for
import { aws_cur } from '@open-constructs/aws-cdk'

aws_cur.CurFormat.for(compression: string, format: string)

Returns a CurFormat instance for the given compression and format string values.

compressionRequired
  • Type: string

The compression string value.


formatRequired
  • Type: string

The format string value.


Properties

Name Type Description
compression string No description.
format string No description.

compressionRequired
public readonly compression: string;
  • Type: string

formatRequired
public readonly format: string;
  • Type: string

Constants

Name Type Description
PARQUET @open-constructs/aws-cdk.aws_cur.CurFormat Parquet format.
TEXT_OR_CSV @open-constructs/aws-cdk.aws_cur.CurFormat GZIP compressed text or CSV format.

PARQUETRequired
public readonly PARQUET: CurFormat;
  • Type: @open-constructs/aws-cdk.aws_cur.CurFormat

Parquet format.


TEXT_OR_CSVRequired
public readonly TEXT_OR_CSV: CurFormat;
  • Type: @open-constructs/aws-cdk.aws_cur.CurFormat

GZIP compressed text or CSV format.


ReportGranularity

Enum for the possible granularities of a cost report.

Initializers

import { aws_cur } from '@open-constructs/aws-cdk'

new aws_cur.ReportGranularity(value: string)
Name Type Description
value string No description.

valueRequired
  • Type: string

Static Functions

Name Description
for Returns a ReportGranularity instance for the given granularity string value.

for
import { aws_cur } from '@open-constructs/aws-cdk'

aws_cur.ReportGranularity.for(granularity: string)

Returns a ReportGranularity instance for the given granularity string value.

granularityRequired
  • Type: string

The granularity string value to create an instance for.


Properties

Name Type Description
value string No description.

valueRequired
public readonly value: string;
  • Type: string

Constants

Name Type Description
DAILY @open-constructs/aws-cdk.aws_cur.ReportGranularity Daily granularity.
HOURLY @open-constructs/aws-cdk.aws_cur.ReportGranularity Hourly granularity.
MONTHLY @open-constructs/aws-cdk.aws_cur.ReportGranularity Weekly granularity.

DAILYRequired
public readonly DAILY: ReportGranularity;
  • Type: @open-constructs/aws-cdk.aws_cur.ReportGranularity

Daily granularity.


HOURLYRequired
public readonly HOURLY: ReportGranularity;
  • Type: @open-constructs/aws-cdk.aws_cur.ReportGranularity

Hourly granularity.


MONTHLYRequired
public readonly MONTHLY: ReportGranularity;
  • Type: @open-constructs/aws-cdk.aws_cur.ReportGranularity

Weekly granularity.


Protocols

IInstanceConnectEndpoint

  • Extends: aws-cdk-lib.aws_ec2.IConnectable, aws-cdk-lib.IResource

  • Implemented By: @open-constructs/aws-cdk.aws_ec2.InstanceConnectEndpoint, @open-constructs/aws-cdk.aws_ec2.IInstanceConnectEndpoint

An EC2 Instance Connect Endpoint.

Properties

Name Type Description
connections aws-cdk-lib.aws_ec2.Connections The network connections associated with this resource.
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
instanceConnectEndpointId string The ID of the EC2 Instance Connect Endpoint.

connectionsRequired
public readonly connections: Connections;
  • Type: aws-cdk-lib.aws_ec2.Connections

The network connections associated with this resource.


nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


instanceConnectEndpointIdRequired
public readonly instanceConnectEndpointId: string;
  • Type: string

The ID of the EC2 Instance Connect Endpoint.