32 lines
874 B
Plaintext
32 lines
874 B
Plaintext
// Fixture with file system and an EC2 instance created in a VPC
|
|
import { Stack } from 'aws-cdk-lib';
|
|
import { Construct } from 'constructs';
|
|
import * as efs from 'aws-cdk-lib/aws-efs';
|
|
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
|
|
class Fixture extends Stack {
|
|
constructor(scope: Construct, id: string) {
|
|
super(scope, id);
|
|
|
|
const vpc = new ec2.Vpc(this, 'VPC');
|
|
|
|
const fileSystem = new efs.FileSystem(this, 'FileSystem', {
|
|
vpc,
|
|
});
|
|
|
|
const instance = new ec2.Instance(this, 'instance', {
|
|
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.LARGE),
|
|
machineImage: new ec2.AmazonLinuxImage({
|
|
generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2
|
|
}),
|
|
vpc,
|
|
vpcSubnets: {
|
|
subnetType: ec2.SubnetType.PUBLIC,
|
|
}
|
|
});
|
|
|
|
/// here
|
|
}
|
|
}
|