DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can isolate the created resources in multiple module imports?

Upon this question:

I make my own terraform module that creates an EC-2 instance and a role for it:

resource "aws_instance" "instance" {
    ami=var.ami
    instance_type="t3a.micro"
    key_name = var.ssh_key
    iam_instance_profile = aws_iam_instance_profile.ec2_profile.name
    root_block_device {
        volume_size = 30
        volume_type = "gp3"
    }

    vpc_security_group_ids=var.ec2_security_groups

    # Ommitted for verbosity reduction
}

resource "aws_route53_record" "domain" {
  zone_id =

I try to make duplicate resources for each environment. Each resource is for a seperate client, therefore, I want each client to have its own folder instead of having seperate folders per environment.

Do you know how I can do that?

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Retry later