Skip to content

Latest commit

 

History

History
778 lines (472 loc) · 31.2 KB

File metadata and controls

778 lines (472 loc) · 31.2 KB

API Reference

Constructs

InstanceService

Initializers

import { InstanceService } from '@renovosolutions/cdk-library-renovo-instance-service'

new InstanceService(scope: Construct, id: string, props: InstanceServiceProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props InstanceServiceProps 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 { InstanceService } from '@renovosolutions/cdk-library-renovo-instance-service'

InstanceService.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
instance aws-cdk-lib.aws_ec2.Instance The underlying instance resource.
instanceAvailabilityZone string The availability zone of the instance.
instanceCfn aws-cdk-lib.aws_ec2.CfnInstance The underlying CfnInstance resource.
instanceEc2PrivateDnsName string Private DNS name for this instance assigned by EC2.
instanceEc2PublicDnsName string Public DNS name for this instance assigned by EC2.
instanceId string The instance's ID.
instancePrivateIp string Private IP for this instance.
instanceProfile aws-cdk-lib.aws_iam.CfnInstanceProfile The instance profile associated with this instance.
instanceRole @renovosolutions/cdk-library-managed-instance-role.ManagedInstanceRole The instance role associated with this instance.
osType aws-cdk-lib.aws_ec2.OperatingSystemType The type of OS the instance is running.
securityGroup aws-cdk-lib.aws_ec2.SecurityGroup The security group associated with this instance.
instanceDnsName aws-cdk-lib.aws_route53.ARecord DNS record for this instance created in Route53.

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

The tree node.


instanceRequired
public readonly instance: Instance;
  • Type: aws-cdk-lib.aws_ec2.Instance

The underlying instance resource.


instanceAvailabilityZoneRequired
public readonly instanceAvailabilityZone: string;
  • Type: string

The availability zone of the instance.


instanceCfnRequired
public readonly instanceCfn: CfnInstance;
  • Type: aws-cdk-lib.aws_ec2.CfnInstance

The underlying CfnInstance resource.


instanceEc2PrivateDnsNameRequired
public readonly instanceEc2PrivateDnsName: string;
  • Type: string

Private DNS name for this instance assigned by EC2.


instanceEc2PublicDnsNameRequired
public readonly instanceEc2PublicDnsName: string;
  • Type: string

Public DNS name for this instance assigned by EC2.


instanceIdRequired
public readonly instanceId: string;
  • Type: string

The instance's ID.


instancePrivateIpRequired
public readonly instancePrivateIp: string;
  • Type: string

Private IP for this instance.


instanceProfileRequired
public readonly instanceProfile: CfnInstanceProfile;
  • Type: aws-cdk-lib.aws_iam.CfnInstanceProfile

The instance profile associated with this instance.


instanceRoleRequired
public readonly instanceRole: ManagedInstanceRole;
  • Type: @renovosolutions/cdk-library-managed-instance-role.ManagedInstanceRole

The instance role associated with this instance.


osTypeRequired
public readonly osType: OperatingSystemType;
  • Type: aws-cdk-lib.aws_ec2.OperatingSystemType

The type of OS the instance is running.


securityGroupRequired
public readonly securityGroup: SecurityGroup;
  • Type: aws-cdk-lib.aws_ec2.SecurityGroup

The security group associated with this instance.


instanceDnsNameOptional
public readonly instanceDnsName: ARecord;
  • Type: aws-cdk-lib.aws_route53.ARecord

DNS record for this instance created in Route53.


ManagedLoggingPolicy

Initializers

import { ManagedLoggingPolicy } from '@renovosolutions/cdk-library-renovo-instance-service'

new ManagedLoggingPolicy(scope: Construct, id: string, props: ManagedLoggingPolicyProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props ManagedLoggingPolicyProps 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 { ManagedLoggingPolicy } from '@renovosolutions/cdk-library-renovo-instance-service'

ManagedLoggingPolicy.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
policy aws-cdk-lib.aws_iam.ManagedPolicy No description.

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

The tree node.


policyRequired
public readonly policy: ManagedPolicy;
  • Type: aws-cdk-lib.aws_iam.ManagedPolicy

Structs

AmiLookup

Initializer

import { AmiLookup } from '@renovosolutions/cdk-library-renovo-instance-service'

const amiLookup: AmiLookup = { ... }

Properties

Name Type Description
name string The name string to use for AMI lookup.
owners string[] The owners to use for AMI lookup.
windows boolean Is this AMI expected to be windows?

nameRequired
public readonly name: string;
  • Type: string

The name string to use for AMI lookup.


ownersOptional
public readonly owners: string[];
  • Type: string[]

The owners to use for AMI lookup.


windowsOptional
public readonly windows: boolean;
  • Type: boolean

Is this AMI expected to be windows?


InstanceServiceProps

Initializer

import { InstanceServiceProps } from '@renovosolutions/cdk-library-renovo-instance-service'

const instanceServiceProps: InstanceServiceProps = { ... }

Properties

Name Type Description
instanceType aws-cdk-lib.aws_ec2.InstanceType The type of instance to launch.
machineImage aws-cdk-lib.aws_ec2.IMachineImage AMI to launch.
name string The name of the service the instance is for.
vpc aws-cdk-lib.aws_ec2.IVpc The VPC to launch the instance in.
allowAllOutbound boolean Whether the instance could initiate connections to anywhere by default.
availabilityZones string[] Select subnets only in the given AZs.
blockDevices aws-cdk-lib.aws_ec2.BlockDevice[] Specifies how block devices are exposed to the instance.
disableInlineRules boolean Whether to disable inline ingress and egress rule optimization for the instances security group.
enableCloudwatchLogs boolean Whether or not to enable logging to Cloudwatch Logs.
enabledNoPublicIngressAspect boolean Whether or not to prevent security group from containing rules that allow access from the public internet: Any rule with a source from 0.0.0.0/0 or ::/0.
enableNoDBPortsAspect boolean Whether or not to prevent security group from containing rules that allow access to relational DB ports: MySQL, PostgreSQL, MariaDB, Oracle, SQL Server.
enableNoRemoteManagementPortsAspect boolean Whether or not to prevent security group from containing rules that allow access to remote management ports: SSH, RDP, WinRM, WinRM over HTTPs.
instanceRole @renovosolutions/cdk-library-managed-instance-role.ManagedInstanceRole The role to use for this instance.
keyName string Name of the SSH keypair to grant access to the instance.
parentDomain string The parent domain of the service.
privateIpAddress string Defines a private IP address to associate with the instance.
requireImdsv2 boolean Whether IMDSv2 should be required on this instance.
securityGroup aws-cdk-lib.aws_ec2.SecurityGroup The security group to use for this instance.
subnetType aws-cdk-lib.aws_ec2.SubnetType The subnet type to launch this service in.
useImdsv2CustomAspect boolean Whether to use th IMDSv2 custom aspect provided by this library or the default one provided by AWS.
userData aws-cdk-lib.aws_ec2.UserData The user data to apply to the instance.

instanceTypeRequired
public readonly instanceType: InstanceType;
  • Type: aws-cdk-lib.aws_ec2.InstanceType

The type of instance to launch.


machineImageRequired
public readonly machineImage: IMachineImage;
  • Type: aws-cdk-lib.aws_ec2.IMachineImage

AMI to launch.


nameRequired
public readonly name: string;
  • Type: string

The name of the service the instance is for.


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

The VPC to launch the instance in.


allowAllOutboundOptional
public readonly allowAllOutbound: boolean;
  • Type: boolean

Whether the instance could initiate connections to anywhere by default.


availabilityZonesOptional
public readonly availabilityZones: string[];
  • Type: string[]

Select subnets only in the given AZs.


blockDevicesOptional
public readonly blockDevices: BlockDevice[];
  • Type: aws-cdk-lib.aws_ec2.BlockDevice[]

Specifies how block devices are exposed to the instance.

You can specify virtual devices and EBS volumes


disableInlineRulesOptional
public readonly disableInlineRules: boolean;
  • Type: boolean
  • Default: false

Whether to disable inline ingress and egress rule optimization for the instances security group.

If this is set to true, ingress and egress rules will not be declared under the SecurityGroup in cloudformation, but will be separate elements.

Inlining rules is an optimization for producing smaller stack templates. Sometimes this is not desirable, for example when security group access is managed via tags.

The default value can be overriden globally by setting the context variable '@aws-cdk/aws-ec2.securityGroupDisableInlineRules'.


enableCloudwatchLogsOptional
public readonly enableCloudwatchLogs: boolean;
  • Type: boolean
  • Default: true

Whether or not to enable logging to Cloudwatch Logs.


enabledNoPublicIngressAspectOptional
public readonly enabledNoPublicIngressAspect: boolean;
  • Type: boolean

Whether or not to prevent security group from containing rules that allow access from the public internet: Any rule with a source from 0.0.0.0/0 or ::/0.

If these sources are used when this is enabled and error will be added to CDK metadata and deployment and synth will fail.


enableNoDBPortsAspectOptional
public readonly enableNoDBPortsAspect: boolean;
  • Type: boolean
  • Default: true

Whether or not to prevent security group from containing rules that allow access to relational DB ports: MySQL, PostgreSQL, MariaDB, Oracle, SQL Server.

If these ports are opened when this is enabled an error will be added to CDK metadata and deployment and synth will fail.


enableNoRemoteManagementPortsAspectOptional
public readonly enableNoRemoteManagementPortsAspect: boolean;
  • Type: boolean
  • Default: true

Whether or not to prevent security group from containing rules that allow access to remote management ports: SSH, RDP, WinRM, WinRM over HTTPs.

If these ports are opened when this is enabled an error will be added to CDK metadata and deployment and synth will fail.


instanceRoleOptional
public readonly instanceRole: ManagedInstanceRole;
  • Type: @renovosolutions/cdk-library-managed-instance-role.ManagedInstanceRole
  • Default: A new ManagedInstanceRole will be created for this instance

The role to use for this instance.


keyNameOptional
public readonly keyName: string;
  • Type: string

Name of the SSH keypair to grant access to the instance.


parentDomainOptional
public readonly parentDomain: string;
  • Type: string

The parent domain of the service.


privateIpAddressOptional
public readonly privateIpAddress: string;
  • Type: string

Defines a private IP address to associate with the instance.


requireImdsv2Optional
public readonly requireImdsv2: boolean;
  • Type: boolean
  • Default: true

Whether IMDSv2 should be required on this instance.


securityGroupOptional
public readonly securityGroup: SecurityGroup;
  • Type: aws-cdk-lib.aws_ec2.SecurityGroup
  • Default: A new SecurityGroup will be created for this instance

The security group to use for this instance.


subnetTypeOptional
public readonly subnetType: SubnetType;
  • Type: aws-cdk-lib.aws_ec2.SubnetType
  • Default: ec2.SubnetType.PRIVATE_WITH_NAT

The subnet type to launch this service in.


useImdsv2CustomAspectOptional
public readonly useImdsv2CustomAspect: boolean;
  • Type: boolean
  • Default: true

Whether to use th IMDSv2 custom aspect provided by this library or the default one provided by AWS.

Turned on by default otherwise we need to apply a feature flag to every project using an instance or apply a breaking change to instance construct ids.

https://github.com/jericht/aws-cdk/blob/56c01aedc4f745eec79409c99b749f516ffc39e1/packages/%40aws-cdk/aws-ec2/lib/aspects/require-imdsv2-aspect.ts#L95


userDataOptional
public readonly userData: UserData;
  • Type: aws-cdk-lib.aws_ec2.UserData

The user data to apply to the instance.


ManagedLoggingPolicyProps

Initializer

import { ManagedLoggingPolicyProps } from '@renovosolutions/cdk-library-renovo-instance-service'

const managedLoggingPolicyProps: ManagedLoggingPolicyProps = { ... }

Properties

Name Type Description
os string The OS of the instance this policy is for.

osRequired
public readonly os: string;
  • Type: string

The OS of the instance this policy is for.