Skip to content

Latest commit

 

History

History
550 lines (336 loc) · 19.2 KB

API.md

File metadata and controls

550 lines (336 loc) · 19.2 KB

API Reference

Constructs

ImagePipeline

Initializers

import { ImagePipeline } from 'cdk-image-pipeline'

new ImagePipeline(scope: Construct, id: string, props: ImagePipelineProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props ImagePipelineProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

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 { ImagePipeline } from 'cdk-image-pipeline'

ImagePipeline.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.
builderSnsTopic aws-cdk-lib.aws_sns.Topic SNS Topic where the internal ImageBuilder will notify about new builds.
pipeline aws-cdk-lib.aws_imagebuilder.CfnImagePipeline The internal image pipeline created by this construct.
imageRecipeComponents aws-cdk-lib.aws_imagebuilder.CfnImageRecipe.ComponentConfigurationProperty[] No description.

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

The tree node.


builderSnsTopicRequired
public readonly builderSnsTopic: Topic;
  • Type: aws-cdk-lib.aws_sns.Topic

SNS Topic where the internal ImageBuilder will notify about new builds.


pipelineRequired
public readonly pipeline: CfnImagePipeline;
  • Type: aws-cdk-lib.aws_imagebuilder.CfnImagePipeline

The internal image pipeline created by this construct.


imageRecipeComponentsRequired
public readonly imageRecipeComponents: ComponentConfigurationProperty[];
  • Type: aws-cdk-lib.aws_imagebuilder.CfnImageRecipe.ComponentConfigurationProperty[]

Structs

ComponentProps

Initializer

import { ComponentProps } from 'cdk-image-pipeline'

const componentProps: ComponentProps = { ... }

Properties

Name Type Description
document string Relative path to Image Builder component document.
name string Name of the Component Document.
version string Version for each component document.

documentRequired
public readonly document: string;
  • Type: string

Relative path to Image Builder component document.


nameRequired
public readonly name: string;
  • Type: string

Name of the Component Document.


versionRequired
public readonly version: string;
  • Type: string

Version for each component document.


ImagePipelineProps

Initializer

import { ImagePipelineProps } from 'cdk-image-pipeline'

const imagePipelineProps: ImagePipelineProps = { ... }

Properties

Name Type Description
components string | ComponentProps[] List of component props.
parentImage string The source (parent) image that the image recipe uses as its base environment.
additionalPolicies aws-cdk-lib.aws_iam.ManagedPolicy[] Additional policies to add to the instance profile associated with the Instance Configurations.
amiIdSsmAccountId string Account ID for Parameter Store path above.
amiIdSsmPath string Parameter Store path to store latest AMI ID under.
amiIdSsmRegion string Region for Parameter Store path above.
distributionAccountIDs string[] List of accounts to copy this AMI to, if the option to do so is enabled.
distributionRegions string[] List of regions to copy this AMI to, if the option to do so is enabled.
ebsVolumeConfigurations VolumeProps[] Configuration for the AMI's EBS volumes.
email string Email used to receive Image Builder Pipeline Notifications via SNS.
enableCrossAccountDistribution boolean Set to true if you want to copy this AMI to other accounts using a Distribution Configuration.
enableVulnScans boolean Set to true if you want to enable continuous vulnerability scans through AWS Inpector.
imageRecipeVersion string Image recipe version (Default: 0.0.1).
instanceTypes string[] List of instance types used in the Instance Configuration (Default: [ 't3.medium', 'm5.large', 'm5.xlarge' ]).
kmsKey aws-cdk-lib.aws_kms.IKey KMS Key used to encrypt the SNS topic.
platform string Platform type Linux or Windows (Default: Linux).
securityGroups string[] List of security group IDs for the Infrastructure Configuration.
subnetId string Subnet ID for the Infrastructure Configuration.
userDataScript string UserData script that will override default one (if specified).
vulnScansRepoName string Store vulnerability scans through AWS Inpsector in ECR using this repo name (if option is enabled).
vulnScansRepoTags string[] Store vulnerability scans through AWS Inpsector in ECR using these image tags (if option is enabled).

componentsRequired
public readonly components: string | ComponentProps[];

List of component props.


parentImageRequired
public readonly parentImage: string;
  • Type: string

The source (parent) image that the image recipe uses as its base environment.

The value can be the parent image ARN or an Image Builder AMI ID


additionalPoliciesOptional
public readonly additionalPolicies: ManagedPolicy[];
  • Type: aws-cdk-lib.aws_iam.ManagedPolicy[]

Additional policies to add to the instance profile associated with the Instance Configurations.


amiIdSsmAccountIdOptional
public readonly amiIdSsmAccountId: string;
  • Type: string

Account ID for Parameter Store path above.


amiIdSsmPathOptional
public readonly amiIdSsmPath: string;
  • Type: string

Parameter Store path to store latest AMI ID under.


amiIdSsmRegionOptional
public readonly amiIdSsmRegion: string;
  • Type: string

Region for Parameter Store path above.


distributionAccountIDsOptional
public readonly distributionAccountIDs: string[];
  • Type: string[]

List of accounts to copy this AMI to, if the option to do so is enabled.


distributionRegionsOptional
public readonly distributionRegions: string[];
  • Type: string[]

List of regions to copy this AMI to, if the option to do so is enabled.


ebsVolumeConfigurationsOptional
public readonly ebsVolumeConfigurations: VolumeProps[];

Configuration for the AMI's EBS volumes.


emailOptional
public readonly email: string;
  • Type: string

Email used to receive Image Builder Pipeline Notifications via SNS.


enableCrossAccountDistributionOptional
public readonly enableCrossAccountDistribution: boolean;
  • Type: boolean

Set to true if you want to copy this AMI to other accounts using a Distribution Configuration.


enableVulnScansOptional
public readonly enableVulnScans: boolean;
  • Type: boolean

Set to true if you want to enable continuous vulnerability scans through AWS Inpector.


imageRecipeVersionOptional
public readonly imageRecipeVersion: string;
  • Type: string

Image recipe version (Default: 0.0.1).


instanceTypesOptional
public readonly instanceTypes: string[];
  • Type: string[]

List of instance types used in the Instance Configuration (Default: [ 't3.medium', 'm5.large', 'm5.xlarge' ]).


kmsKeyOptional
public readonly kmsKey: IKey;
  • Type: aws-cdk-lib.aws_kms.IKey

KMS Key used to encrypt the SNS topic.


platformOptional
public readonly platform: string;
  • Type: string

Platform type Linux or Windows (Default: Linux).


securityGroupsOptional
public readonly securityGroups: string[];
  • Type: string[]

List of security group IDs for the Infrastructure Configuration.


subnetIdOptional
public readonly subnetId: string;
  • Type: string

Subnet ID for the Infrastructure Configuration.


userDataScriptOptional
public readonly userDataScript: string;
  • Type: string
  • Default: none

UserData script that will override default one (if specified).


vulnScansRepoNameOptional
public readonly vulnScansRepoName: string;
  • Type: string

Store vulnerability scans through AWS Inpsector in ECR using this repo name (if option is enabled).


vulnScansRepoTagsOptional
public readonly vulnScansRepoTags: string[];
  • Type: string[]

Store vulnerability scans through AWS Inpsector in ECR using these image tags (if option is enabled).


VolumeProps

Initializer

import { VolumeProps } from 'cdk-image-pipeline'

const volumeProps: VolumeProps = { ... }

Properties

Name Type Description
deviceName string Name of the volume.
ebs aws-cdk-lib.aws_imagebuilder.CfnImageRecipe.EbsInstanceBlockDeviceSpecificationProperty EBS Block Store Parameters.

deviceNameRequired
public readonly deviceName: string;
  • Type: string

Name of the volume.


ebsRequired
public readonly ebs: EbsInstanceBlockDeviceSpecificationProperty;
  • Type: aws-cdk-lib.aws_imagebuilder.CfnImageRecipe.EbsInstanceBlockDeviceSpecificationProperty

EBS Block Store Parameters.