} from '@aws-cdk/core'; import { CfnAccelerator, CfnListener, CfnEndpointGroup } from '@aws-cdk/aws-globalaccelerator'; export class GlobalAcceleratorStack extends Stack { constructor(scope: Construct, id: string) { super(scope, id); const cfnAccelerator = new CfnAccelerator(this, 'CfnAccelerator', { name: 'AcceleratorNameTest' }) const cfnListener = new CfnListener(this, 'CfnListener', { acceleratorArn: cfnAccelerator.attrAcceleratorArn, portRanges: [{ fromPort: 80, toPort: 80 }], protocol: 'TCP', }) new CfnEndpointGroup(this, 'CfnEndpointGroup', { endpointGroupRegion: 'ap-northeast-1', listenerArn: cfnListener.attrListenerArn, }) } } const app = new App(); new GlobalAcceleratorStack(app, 'cdk-migrantion-test'); app.synth(); CDK for Terraform #!/usr/bin/env node import { Construct } from 'constructs'; import { App, TerraformStack as Stack, Token } from 'cdktf'; import { AwsProvider } from './.gen/providers/aws' import { GlobalacceleratorAccelerator as CfnAccelerator } from './.gen/providers/aws/globalaccelerator-accelerator'; import { GlobalacceleratorListener as CfnListener } from './.gen/providers/aws/globalaccelerator-listener'; import { GlobalacceleratorEndpointGroup as CfnEndpointGroup } from './.gen/providers/aws/globalaccelerator-endpoint-group'; export class GlobalAcceleratorStack extends Stack { constructor(scope: Construct, id: string) { super(scope, id); new AwsProvider(this, 'aws', { region: 'ap-northeast-1' }); const cfnAccelerator = new CfnAccelerator(this, 'CfnAccelerator', { name: 'AcceleratorNameTest' }) const cfnListener = new CfnListener(this, 'CfnListener', { acceleratorArn: Token.asString(cfnAccelerator.id), portRange: [{ fromPort: 80, toPort: 80 }], protocol: 'TCP', }) new CfnEndpointGroup(this, 'CfnEndpointGroup', { endpointGroupRegion: 'ap-northeast-1', listenerArn: Token.asString(cfnListener.id), }) } } const app = new App(); new GlobalAcceleratorStack(app, 'cdk-migrantion-test'); app.synth();