import { Construct } from "constructs";
import { App, TerraformStack } from "cdktf";
import {AwsProvider, EC2,S3Bucket,SnsTopic} from ".gen/providers/aws";
class MyStack extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
// define resources here
new AwsProvider(this, "aws", {
region: "us-east-1",
});
new EC2.Instance(this, "my-ec2-instance", {
ami: "ami-2757f631",
instanceType: "t2.micro",
});
new S3Bucket(this, name, {
bucket: name,
tags: [],
});
new SnsTopic(this, "Topic", {
displayName: "my-sns-topic",
});
}
}
const app = new App();
new MyStack(app, "cdk-terraform-tutorial-typescript");
app.synth();