Commit Graph

3184 Commits

Author SHA1 Message Date
Sander van Harmelen 57ae6a5da6 Fixing aws_instance schema
Some instance types have a block device by default. So when selecting
such an instance type, you will not set a config for the block device,
but the update/refresh func will notice one and update the state
nonetheless.

So in those cases the `block_device` becomes a `computed` field.
2014-12-25 21:58:26 +01:00
Sander van Harmelen d448c1b9ac Merge pull request #712 from svanharmelen/f-fix-aws-instance-resource
provider/aws: fixing some logic issues with the aws-instance resource
2014-12-25 18:50:33 +01:00
Sander van Harmelen b96f373ee9 Fixing some logic issues with the aws-instance resource
1. The schema contained a few fields that where not marked as
`computed`, while they were updated inside the resource.

2. While updating the `volume_size` it was doing so with a `string`,
but in the schema this field is set as `int`.

3. The set func for calculating the hashes for the `block` set items,
also used computed values to calculate the hash. As these values will
not be in the config, but only in the state, this will always show as a
diff. The solution is to only use the fields that aren’t computed in
order to get consistent hashes.

These where all issues before, but weren’t visible as such. All should
be good again now.
2014-12-25 18:21:05 +01:00
Dr Nic Williams e5aedc70af make dev also puts bins into $GOPATH/bin 2014-12-23 17:54:43 -08:00
Yahya Poonawala 7e4f417107 Updating markdown file for VPC to reflect addition of default network acl id and security group id. 2014-12-23 11:49:07 +05:30
Yahya Poonawala 7860dc1ef6 Adding default security group id attribute reference on creation of VPC. Fixes issue #466. 2014-12-23 11:43:33 +05:30
Yahya Poonawala 634984532d Adding default network acl id attribute reference on creation of VPC. Fixes issue #466. 2014-12-22 23:08:15 +05:30
Luke Amdor e970eea3cd adding literal colon to interpolated regex 2014-12-21 14:13:41 -06:00
Emil Hessman 13f1f1f9ad builtin/providers/aws: acceptance tests for assigning private IPs on AWS instance 2014-12-20 20:48:07 +01:00
Mitchell Hashimoto 73726e83b2 helper/schema: DiffFieldReader for reading data from a diff 2014-12-20 02:17:35 +05:30
Sander van Harmelen fd6382fbaf Merge pull request #699 from svanharmelen/f-provider/cloudstack-small-fix
provider/cloudstack: changing this fixes an Excoscale issue where 'all' is not allowed
2014-12-19 19:21:47 +01:00
Sander van Harmelen bb3bbcc0fc Changing this fixes an Excoscale issue where 'all' is not allowed 2014-12-19 19:14:46 +01:00
Mitchell Hashimoto 9447973015 helper/schema: ConfigFieldReader and generic helpers 2014-12-19 22:52:53 +05:30
Mitchell Hashimoto 5f063d321f helper/schema: FieldReader needs to return computed status 2014-12-19 06:15:04 -05:00
Mitchell Hashimoto f416e0edf0 helper/schema: FieldReader and MapFieldReader 2014-12-19 05:56:46 -05:00
Mitchell Hashimoto 08348eed28 config: some extra comments 2014-12-18 11:50:01 -08:00
Pete Hodgson 5b66b9306e add aws_key_pair resource
For now this only supports importing a key pair (by specifying a
public_key) property. In the future it'd be fairly trivial to support
key pair creation, with the private key returned as a computed property.

In real world usage you'd probably want to provide that public_key
property via a variable rather than hard-coding it into a terraform
config that'd end up in source control.
2014-12-18 01:27:06 -08:00
Sander van Harmelen 6a6ae12fd2 Merge pull request #690 from svanharmelen/f-provider/aws-fix-elb-resource
provider/aws: updated the security_group attribute to use a set
2014-12-17 23:59:50 +01:00
Sander van Harmelen b58e468033 Updated the security_group attribute to use a set
This way the order returned by the API has no impact on the saved
state, preventing false positives when diffing.
2014-12-17 23:53:01 +01:00
Mitchell Hashimoto e6289fbe63 Update CHANGELOG 2014-12-17 11:40:53 -08:00
Sander van Harmelen 54e558af82 Merge pull request #688 from ceh/yavf
yet another vet fix round
2014-12-17 13:10:05 +01:00
Emil Hessman fc36b1cd94 command: vet fix
Fixes the following vet report:

command/remote.go:165: wrong number of args for format in Sprintf call: 1 needed but 2 args
2014-12-17 13:02:19 +01:00
Emil Hessman 68a41035a9 builtin/providers/mailgun: vet fix
Fixes the following vet report:

builtin/providers/mailgun/resource_mailgun_domain_test.go:73: arg DomainResp.Domain.Wildcard for printf verb %s of wrong type: bool
2014-12-17 12:59:07 +01:00
Emil Hessman 7b704fb77d builtin/providers/heroku: vet fix
Fixes the following vet reports:

builtin/providers/heroku/resource_heroku_app.go:192: arg vs for printf verb %s of wrong type: bool
builtin/providers/heroku/resource_heroku_app.go:198: arg vs for printf verb %s of wrong type: bool
2014-12-17 12:58:12 +01:00
Emil Hessman 4f3f85b165 builtin/providers/aws: vet fix
Fixes the following vet reports:

builtin/providers/aws/resource_aws_network_acl.go:191: wrong number of args for format in Errorf call: 2 needed but 3 args
builtin/providers/aws/resource_aws_network_acl.go:264: wrong number of args for format in Errorf call: 1 needed but 2 args
builtin/providers/aws/resource_aws_network_acl.go:268: wrong number of args for format in Errorf call: 1 needed but 2 args
builtin/providers/aws/resource_aws_network_acl.go:286: arg m[to_port].(int) for printf verb %s of wrong type: int
builtin/providers/aws/resource_aws_network_acl_test.go:277: arg r.NetworkAcls for printf verb %s of wrong type: []github.com/mitchellh/goamz/ec2.NetworkAcl
builtin/providers/aws/resource_aws_subnet_test.go:21: arg v.MapPublicIpOnLaunch for printf verb %s of wrong type: bool
2014-12-17 12:37:46 +01:00
Emil Hessman 95fa353ee9 builtin/providers/atlas: vet fix
Fixes the following vet report:

builtin/providers/atlas/resource_artifact.go:139: arg user for printf verb %d of wrong type: string
2014-12-17 12:28:28 +01:00
Mitchell Hashimoto 1429ac6a7f terraform: return unknown variable value if nil 2014-12-16 18:43:18 -08:00
Mitchell Hashimoto 71918efd96 terraform: Add more tests for cases we felt weren't well covered 2014-12-16 15:59:26 -08:00
Mitchell Hashimoto e8ac16b2df helper/schema: test for empty state 2014-12-16 15:56:40 -08:00
Mitchell Hashimoto 3b5c8a44ea Merge pull request #685 from svanharmelen/f-add-test-for-diffing-diffs
core: adding a test for the change in PR #681 (diffing diffs)
2014-12-16 10:23:42 -08:00
Sander van Harmelen 8347569396 Adding a test for the change in PR #681
Should have already done that together with that PR…
2014-12-16 19:15:07 +01:00
Mitchell Hashimoto 2ba827ee3a update CHANGELOG 2014-12-16 09:16:11 -08:00
Mitchell Hashimoto af52e744da Merge pull request #682 from svanharmelen/f-provider/aws-fix-tests
provider/aws: updating the tests and refactoring the code a little
2014-12-16 09:14:41 -08:00
Mitchell Hashimoto e39aaa6604 Merge pull request #678 from hashicorp/track-map-element-count
helper/schema: track map element counts
2014-12-16 09:09:35 -08:00
Mitchell Hashimoto df05483cf6 helper/schema: test pass from SvH 2014-12-16 09:05:16 -08:00
Mitchell Hashimoto ef60ac5b8c terraform: update comment 2014-12-16 08:24:21 -08:00
Mitchell Hashimoto e5f07567c6 terraform: module input to another module doesn't error [GH-659] 2014-12-16 08:23:19 -08:00
Sander van Harmelen 9797881ed8 Updating the tests and refactoring the code a little
There was an error in the goamz package the prevented updating the
availability zones correctly. So PR #181 should be merged before this
one can be merged…
2014-12-16 15:21:25 +01:00
Sander van Harmelen e1201f079a Merge pull request #681 from svanharmelen/f-core-fix-diffing-diffs
core: adding a small fix to the Same() func (diffing diffs)
2014-12-16 15:19:03 +01:00
Sander van Harmelen d24ab685d0 Adding a small fix to the Same() func
This is a little tricky, but when a diff contains a computed list or
set that can only be interpolated after the apply command has created
the dependant resources, it could turn out that the result is actually
the same as the existing state which would remove the key from the diff
2014-12-16 13:58:31 +01:00
Sander van Harmelen 462cc24ce6 Merge pull request #680 from svanharmelen/f-provider/aws-update-aws-elb-resource
provider/aws: updating the resource to use a set instead of a list
2014-12-16 13:19:46 +01:00
Sander van Harmelen 3aeba87e38 Updating the resource to use a set instead of a list
By using a set for the availability zones, you can use things like
`availability_zones = ["${aws_instance.web.*.availability_zone}"]`
where is very likely multiple of the same zones will be added to the
set. If you use a list here, the list will say it’s changed (even if
you add the same zone) which will force a new resource.
2014-12-16 13:13:59 +01:00
Sander van Harmelen 7e091dd7bd Merge pull request #677 from svanharmelen/f-provider-aws-fix-route53-toggling
provider/aws: fixing the flipflop problem for the aws_route53 resource
2014-12-16 11:22:54 +01:00
Sander van Harmelen a7667986f9 Updated the code so it makes use of the available functionality
The `helper/schema` package already knows how to create a set from a
slice with set items. So let’s use that functionality…
2014-12-16 11:14:33 +01:00
Sander van Harmelen 40ca4c1c81 Merge pull request #676 from svanharmelen/f-fix-expand-bug
core: fix expand bug
2014-12-16 11:04:25 +01:00
Mitchell Hashimoto 8426f5140b Update CHANGELOG 2014-12-15 22:14:08 -08:00
Mitchell Hashimoto 675eab11d3 Merge pull request #679 from hashicorp/b-fix-module=type
config: validate that module variables can go to ints, convert [GH-624]
2014-12-15 22:13:02 -08:00
Mitchell Hashimoto d24082da1e config: validate that module variables can go to ints, convert [GH-624] 2014-12-15 22:10:16 -08:00
Mitchell Hashimoto 913f9a923e helper/schema: remove unnecessary code 2014-12-15 17:39:07 -08:00
Mitchell Hashimoto e5877543b2 helper/schema: track map element counts
This adds "field.#" values to the state/diff with the element count of a
map. This fixes a major issue around not knowing when child elements are
computed when doing variable access of a computed map.

Example, if you have a schema like this:

    "foo": &Schema{
        Type:     TypeMap,
        Computed: true,
    }

And you access it like this in a resource:

    ${type.name.foo.computed-field}

Then Terraform will error that "field foo could not be found on resource
type.name". By adding that "foo.#" is computed, Terraform core will pick
up that it WILL exist, so its okay.
2014-12-15 17:35:16 -08:00