Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to manage AWS_EBS_VOLUME #2043

Closed
ghost opened this issue May 22, 2015 · 13 comments
Closed

how to manage AWS_EBS_VOLUME #2043

ghost opened this issue May 22, 2015 · 13 comments

Comments

@ghost
Copy link

ghost commented May 22, 2015

I have a question: in my AWS infrastructure I want to attach a separated ebs volume (created with AWS_EBS_VOLUME resource) to one EC2 instance (created by AWS_INSTANCE resource); But I don't find any information how to do that;

The documentation doesn't have an example. Is it already possible?

Thx

@phinze
Copy link
Contributor

phinze commented May 22, 2015

@julienlavergne unless I'm missing something, we don't have support for this yet.

Seems like we could use an aws_volume_attachment resource.

@catsby thing you might be able to swoop in to the rescue? Seems like it should be a relatively simple one. Maybe even @cbednarski would like to jump in and take a stab at it. 👯

@ghost
Copy link
Author

ghost commented May 22, 2015

That would be great and I think it can answer to many simple cases (ensuring ebs resources persistence when you modify the infrastructure).
 

-- 
Julien Lavergne
Sent with Airmail

On May 22, 2015 at 3:26:44 PM, Paul Hinze ([email protected]) wrote:

@julienlavergne unless I'm missing something, we don't have support for this yet.

Seems like we could use an aws_volume_attachment resource.

@catsby thing you might be able to swoop in to the rescue? Seems like it should be a relatively simple one. Maybe even @cbednarski would like to jump in and take a stab at it.


Reply to this email directly or view it on GitHub.

@uxp
Copy link

uxp commented May 22, 2015

Is this a duplicate of #2019 ?

@uxp
Copy link

uxp commented May 22, 2015

I think this is an example of the behavior we're expecting:

resource "aws_instance" "example" {
    ami = "ami-0ba6873b"
    instance_type = "t2.medium"
    subnet_id = "${aws_subnet.example.id}"
    key_name = "${aws_key_pair.example.key_name}"
    security_groups = [
        "${aws_security_group.example.id}"
    ]
    ebs_block_device = "${aws_ebs_volume.example.id}"
}

resource "aws_ebs_volume" "example" {
    availability_zone = "us-west-2b"
    encrypted = false
    iops = 500
    size = 250
    type = "io1"
}

note that ebs_block_device within the aws_instance resource is invalid syntax against v0.5.1

@catsby
Copy link
Contributor

catsby commented May 22, 2015

@uxp ebs_block_device in an aws_instance configuration is a block of attributes:

I'm working on this:

resource "aws_instance" "web" {
    ami = "ami-21f78e11"
    instance_type = "t1.micro"
    tags {
        Name = "HelloWorld"
    }
}

resource "aws_ebs_volume" "example" {
    availability_zone = "${aws_instance.web.availability_zone}"
    size = 1
}

resource "aws_volume_attachment" "ebs_att" {
  device_name = "/dev/sdh"
    volume_id = "${aws_ebs_volume.example.id}"
    instance_id = "${aws_instance.web.id}"
}

@uxp
Copy link

uxp commented May 22, 2015

Oh perfect. Yes. I know the correct syntax, I was trying to convey the behavior one might expect given an aws_instance resource and an aws_ebs_volume resource, which logically can be paired in some manner.

Looks like I'm late to the party anyways. Thanks, and sorry for the noise.

@catsby
Copy link
Contributor

catsby commented May 22, 2015

not noise, clarity that my approach is what you're expecting 😄

@ghost
Copy link
Author

ghost commented May 22, 2015

Just i talked to phinze and the work is in progress :-)

Thx dev team

Julien

Le 22 mai 2015 à 18:18, HPLogsdon [email protected] a écrit :

Is this a duplicate of #2019 ?


Reply to this email directly or view it on GitHub.

@ghost
Copy link
Author

ghost commented May 22, 2015

I read that and that seems perfect as solution ;)

@ghost
Copy link
Author

ghost commented May 22, 2015

the @catsby approach is really good

@ghost
Copy link
Author

ghost commented May 23, 2015

any commit?

@catsby
Copy link
Contributor

catsby commented May 26, 2015

Closing. Follow #2050 if you're interested 😄

@catsby catsby closed this as completed May 26, 2015
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants