Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Terraform plugin private IP and logicalID allocation #395

Merged
merged 2 commits into from
Feb 14, 2017

Conversation

ndegory
Copy link
Contributor

@ndegory ndegory commented Feb 10, 2017

Fixes #393

When using logical ID allocations, if the private_ip property of the terraform plugin is set to INSTANCE_LOGICAL_ID, the property is replaced with the logical ID. Only enabled for AWS.

Usage example:

  {
    "Plugin": "group",
    "Properties": {
      "ID": "swarm-manager",
      "Properties": {
        "Allocation": {
          "LogicalIDs": [
            "192.168.2.200",
            "192.168.2.201",
            "192.168.2.202"
          ]
        },
        "Instance": {
          "Plugin": "instance-terraform",
          "Properties": {
            "Type": "aws_instance",
            "Value": {
              "ami": "${lookup(var.aws_amis, var.aws_region)}",
              "instance_type": "${var.aws_instance_type}",
              "key_name": "${var.aws_key_name}",
              "vpc_security_group_ids": ["${aws_security_group.default.id}"],
              "subnet_id": "${aws_subnet.default.id}",
              "private_ip": "INSTANCE_LOGICAL_ID"
              },
              "connection": {
                "user": "${var.aws_connection_user}"
              }
            }
          }
        },
        ...

in conjonction with the swarm flavor plugin.

Needs PR #392 to be applied first.

@ndegory
Copy link
Contributor Author

ndegory commented Feb 11, 2017

@chungers thank you for merging #392, I can rebase this PR on master and force push it if it helps, please tell me.

@chungers chungers added this to the v0.4 milestone Feb 12, 2017
@codecov-io
Copy link

codecov-io commented Feb 12, 2017

Codecov Report

Merging #395 into master will decrease coverage by -0.01%.
The diff coverage is 62.5%.

@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
- Coverage   62.57%   62.57%   -0.01%     
==========================================
  Files          56       56              
  Lines        3129     3137       +8     
==========================================
+ Hits         1958     1963       +5     
- Misses        944      945       +1     
- Partials      227      229       +2
Impacted Files Coverage Δ
examples/instance/terraform/plugin.go 51.45% <62.5%> (+0.29%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a9cddb...ae80637. Read the comment docs.

@ndegory
Copy link
Contributor Author

ndegory commented Feb 13, 2017

rebased on master

@chungers
Copy link
Contributor

@ndegory - thanks - nice work!

@chungers chungers merged commit 050a6a9 into docker-archive:master Feb 14, 2017
chungers pushed a commit to chungers/infrakit that referenced this pull request Sep 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants