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

aws_spot_fleet_request not respect key_name and iam_instance_profile #492

Closed
hashibot opened this issue Jun 13, 2017 · 6 comments
Closed
Labels
bug Addresses a defect in current functionality.

Comments

@hashibot
Copy link

This issue was originally opened by @benjah1 as hashicorp/terraform#11447. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.8.4

Affected Resource(s)

  • aws_spot_fleet_request

Terraform Configuration Files

resource "aws_spot_fleet_request" "spot" {
        iam_fleet_role = "arn:aws:iam::xxx:role/aws-ec2-spot-fleet-role"
        allocation_strategy = "lowestPrice"
        target_capacity = 1
        valid_until = "2018-01-01T00:00:00Z"
        spot_price = "0.108"

        launch_specification {
                instance_type = "m4.large"
                ami = "ami-64270201"
                iam_instance_profile = "ecsInstanceRole"
                spot_price = "0.108"
                availability_zone = "us-east-2a"
                subnet_id = "${data.aws_subnet.subnet.id}"
                vpc_security_group_ids = ["${data.aws_security_group.sg.id}"]
                ebs_optimized = true
    }
}

Expected Behavior

To create spot fleet request,

  1. without key pair
  2. with IAM role "ecsInstanceRole"

Actual Behavior

  1. Instance fail to start with failed: Invalid value '' for keyPairNames. It should not be blank.
  2. IAM role is empty.

Note

I also try with key_name = false, but it just convert to "0".

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@svenwltr
Copy link
Contributor

This is still an issue with v0.9.11. If I see it correctly it is because Terraform sends an empty key_name, but it would work if the field wouldn't get sent at all.

@svenwltr
Copy link
Contributor

svenwltr commented Aug 1, 2017

  1. Got solved in fix empty key_name on aws_spot_fleet_request #1203 and will probably part of the next release (0.1.4).
  2. The IAM role doesn't get created by Terraform nor implicitly by the AWS API (but yes, the AWS Web UI implicitly does this). This should be an existing role with the proper access rights.

@Ninir
Copy link
Contributor

Ninir commented Aug 10, 2017

Hey @svenwltr

Since the UI does it for you, it is part of the process of doing it. I personally don't think Terraform should handle it, and hide some magic.

I would like to close the issue since the bug has been fixed. Tell me what you think 😄

@Ninir Ninir added the waiting-response Maintainers are waiting on response from community or contributor. label Aug 10, 2017
@svenwltr
Copy link
Contributor

@Ninir I fully agree with not doing any magic in Terraform. Also, I am already slightly annoyed by the UI, when it created some random roles in the background.

Yes, this issue is resolved to me too.

@Ninir
Copy link
Contributor

Ninir commented Aug 10, 2017

Thank you for the quick answer @svenwltr :) 👍

@Ninir Ninir closed this as completed Aug 10, 2017
@ghost
Copy link

ghost commented Apr 11, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
@breathingdust breathingdust removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

No branches or pull requests

4 participants