Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Resource Dependencies

Sumit Rawal answered on May 14, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • dependencies
  • What is "Representation" of a Resource?

  • Resource Dependencies

    0

    In terraform we usually have more than one modules and modules that depend on another module to fully enable infrastructure. In this way one resource is dependent on another resources.

    for example let’s update the example to

    resource “aws_eip” “ip” {

    instance = “${aws_instance.example.id}”

    }

    This should look familiar from the earlier example of adding an EC2 instance resource, except this time we’re building an “aws_eip” resource type. This resource type allocates and associates anelastic IP to an EC2 instance.

    The only parameter for aws_eip is “instance” which is the EC2 instance to assign the IP to. For this value, we use an interpolation to use an attribute from the EC2 instance we managed earlier.

    The syntax for this interpolation should be straightforward: it requests the “id” attribute from the “aws_instance.example” resource.

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 14 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.