diff --git a/packages/shared-vpc/README.md b/packages/shared-vpc/README.md index 954b44e2..5b2e8336 100644 --- a/packages/shared-vpc/README.md +++ b/packages/shared-vpc/README.md @@ -12,13 +12,16 @@ The following can be used to provision a shared VPC. import 'source-map-support/register'; import * as cdk from '@aws-cdk/core'; import { Construct, Stack, StackProps } from '@aws-cdk/core'; -import { SharedVpc, SharedVpcProps } from '@aligent/cdk-shared-vpc'; +import { SharedVpc, SharedVpcProps, Zone } from '@aligent/cdk-shared-vpc'; +const hostedZones: Zone[] = [ + { type: "A", target: "10.6.0.12", record: "subdomain" } +] const sharedVpcProps : SharedVpcProps = { vpcName: 'my-vpc-name', cidr: '10.0.0.0/16', hostedZoneDomain: 'example.com', - hostedZoneRecords: "[{ "type": "A", "target": "10.6.0.12", "record": "subdomain" }]" + hostedZoneRecords: hostedZones }; class MyStack extends Stack { diff --git a/packages/shared-vpc/lib/shared-vpc.ts b/packages/shared-vpc/lib/shared-vpc.ts index 5dda61ec..208c5e57 100644 --- a/packages/shared-vpc/lib/shared-vpc.ts +++ b/packages/shared-vpc/lib/shared-vpc.ts @@ -4,7 +4,7 @@ import { ARecord, CnameRecord, PrivateHostedZone, RecordTarget } from '@aws-cdk/ const DEFAULT_ZONE_RECORD_SUFFIX = 'root'; -type Zone = { +export type Zone = { type: string, target: string, record?: string