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

Accept an AWS instance-profile #232

Merged

Conversation

dacbd
Copy link
Contributor

@dacbd dacbd commented Oct 26, 2021

I can close the draft if preferred, but I figured I'd put it up for the sake of visibility.

  • I can rebase out my go.mod/sum changes caused by go mod tidy
  • undo go fmt spacing changes?

@dacbd dacbd force-pushed the aws-instance-profile branch 2 times, most recently from f226fb2 to b587f1b Compare October 26, 2021 21:52
@dacbd
Copy link
Contributor Author

dacbd commented Oct 26, 2021

Manually tested with:

terraform {
  required_providers {
    iterative = {
      source = "github.com/iterative/iterative"
    }
  }
}

provider "iterative" {}
resource "iterative_machine" "runner-test" {
    metadata = {
        test = "true"
        createdwith = "terraform"
    }
    cloud = "aws"
    region = "us-west-2"
    instance_permission_set = "arn:aws:iam::1234567890:instance-profile/xxxxx"
    aws_security_group = "ghar"
    instance_type = "t1.micro"
    ssh_private = <<EOF
-----BEGIN RSA PRIVATE KEY-----
XXX
-----END RSA PRIVATE KEY-----
EOF
}
resource "iterative_machine" "runner-neg-test" {
    metadata = {
        test = "true"
        createdwith = "terraform"
    }
    cloud = "aws"
    region = "us-west-2"
    instance_type = "t1.micro"
    aws_security_group = "ghar"
    ssh_private = <<EOF
-----BEGIN RSA PRIVATE KEY-----
XXX
-----END RSA PRIVATE KEY-----
EOF
}

aws --cli-auto-prompt 
> aws ec2 describe-instances --instance-ids i-07035b022a6cc5633
{
    "Reservations": [
        {
            "Groups": [],
            "Instances": [
                {
                    "AmiLaunchIndex": 0,
                    "ImageId": "ami-000b8f33fa58f7f7d",
                    "InstanceId": "i-07035b022a6cc5633",
                    "InstanceType": "t1.micro",
                    "KeyName": "iterative-kit44uiox9zx",
...
                    "IamInstanceProfile": {
                        "Arn": "arn:aws:iam::xxx:instance-profile/xxxx",
                        "Id": "AIPAT2FAEH6UQXSEMPGTY"
                    },
...

@dacbd dacbd marked this pull request as ready for review October 27, 2021 03:44
@DavidGOrtega DavidGOrtega self-requested a review November 1, 2021 22:46
@DavidGOrtega DavidGOrtega changed the base branch from master to instance_permission_set November 2, 2021 15:07
Copy link
Contributor

@DavidGOrtega DavidGOrtega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm

Thanks a lot for the effort 🙏 ❤️

@DavidGOrtega DavidGOrtega merged this pull request into iterative:instance_permission_set Nov 2, 2021
@DavidGOrtega DavidGOrtega mentioned this pull request Nov 2, 2021
DavidGOrtega pushed a commit that referenced this pull request Nov 2, 2021
* prelim provider tweak with go fmt

* get perm value from schema
DavidGOrtega pushed a commit that referenced this pull request Nov 2, 2021
* prelim provider tweak with go fmt

* get perm value from schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants