vendor: github.com/terraform-providers/terraform-provider-aws/...@v0.1.4
This commit is contained in:
parent
24d5b13cac
commit
1c0ee7360e
22
vendor/github.com/terraform-providers/terraform-provider-aws/aws/data_source_aws_vpc.go
generated
vendored
22
vendor/github.com/terraform-providers/terraform-provider-aws/aws/data_source_aws_vpc.go
generated
vendored
|
@ -61,16 +61,6 @@ func dataSourceAwsVpc() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"enable_dns_hostnames": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"enable_dns_support": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"tags": tagsSchemaComputed(),
|
||||
},
|
||||
}
|
||||
|
@ -142,17 +132,5 @@ func dataSourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error {
|
|||
d.Set("ipv6_cidr_block", vpc.Ipv6CidrBlockAssociationSet[0].Ipv6CidrBlock)
|
||||
}
|
||||
|
||||
attResp, err := awsVpcDescribeVpcAttribute("enableDnsSupport", *vpc.VpcId, conn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d.Set("enable_dns_support", attResp.EnableDnsSupport.Value)
|
||||
|
||||
attResp, err = awsVpcDescribeVpcAttribute("enableDnsHostnames", *vpc.VpcId, conn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d.Set("enable_dns_hostnames", attResp.EnableDnsHostnames.Value)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -58,13 +58,6 @@ func resourceAwsEMRCluster() *schema.Resource {
|
|||
Type: schema.TypeString,
|
||||
ForceNew: true,
|
||||
Optional: true,
|
||||
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
|
||||
// EMR uses a proprietary filesystem called EMRFS
|
||||
// and both s3n & s3 protocols are mapped to that FS
|
||||
// so they're equvivalent in this context (confirmed by AWS support)
|
||||
old = strings.Replace(old, "s3n://", "s3://", -1)
|
||||
return old == new
|
||||
},
|
||||
},
|
||||
"master_public_dns": {
|
||||
Type: schema.TypeString,
|
||||
|
|
|
@ -107,7 +107,6 @@ func resourceAwsInstance() *schema.Resource {
|
|||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
ConflictsWith: []string{"user_data_base64"},
|
||||
StateFunc: func(v interface{}) string {
|
||||
switch v.(type) {
|
||||
case string:
|
||||
|
@ -118,22 +117,6 @@ func resourceAwsInstance() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"user_data_base64": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
ConflictsWith: []string{"user_data"},
|
||||
ValidateFunc: func(v interface{}, name string) (warns []string, errs []error) {
|
||||
s := v.(string)
|
||||
if !isBase64Encoded([]byte(s)) {
|
||||
errs = append(errs, fmt.Errorf(
|
||||
"%s: must be base64-encoded", name,
|
||||
))
|
||||
}
|
||||
return
|
||||
},
|
||||
},
|
||||
|
||||
"security_groups": {
|
||||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
|
@ -736,18 +719,9 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
|||
return err
|
||||
}
|
||||
if attr.UserData != nil && attr.UserData.Value != nil {
|
||||
// Since user_data and user_data_base64 conflict with each other,
|
||||
// we'll only set one or the other here to avoid a perma-diff.
|
||||
// Since user_data_base64 was added later, we'll prefer to set
|
||||
// user_data.
|
||||
_, b64 := d.GetOk("user_data_base64")
|
||||
if b64 {
|
||||
d.Set("user_data_base64", attr.UserData.Value)
|
||||
} else {
|
||||
d.Set("user_data", userDataHashSum(*attr.UserData.Value))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -1235,9 +1209,10 @@ func fetchRootDeviceName(ami string, conn *ec2.EC2) (*string, error) {
|
|||
func buildNetworkInterfaceOpts(d *schema.ResourceData, groups []*string, nInterfaces interface{}) []*ec2.InstanceNetworkInterfaceSpecification {
|
||||
networkInterfaces := []*ec2.InstanceNetworkInterfaceSpecification{}
|
||||
// Get necessary items
|
||||
associatePublicIPAddress := d.Get("associate_public_ip_address").(bool)
|
||||
subnet, hasSubnet := d.GetOk("subnet_id")
|
||||
|
||||
if hasSubnet {
|
||||
if hasSubnet && associatePublicIPAddress {
|
||||
// If we have a non-default VPC / Subnet specified, we can flag
|
||||
// AssociatePublicIpAddress to get a Public IP assigned. By default these are not provided.
|
||||
// You cannot specify both SubnetId and the NetworkInterface.0.* parameters though, otherwise
|
||||
|
@ -1246,15 +1221,12 @@ func buildNetworkInterfaceOpts(d *schema.ResourceData, groups []*string, nInterf
|
|||
// to avoid: Network interfaces and an instance-level security groups may not be specified on
|
||||
// the same request
|
||||
ni := &ec2.InstanceNetworkInterfaceSpecification{
|
||||
AssociatePublicIpAddress: aws.Bool(associatePublicIPAddress),
|
||||
DeviceIndex: aws.Int64(int64(0)),
|
||||
SubnetId: aws.String(subnet.(string)),
|
||||
Groups: groups,
|
||||
}
|
||||
|
||||
if v, ok := d.GetOkExists("associate_public_ip_address"); ok {
|
||||
ni.AssociatePublicIpAddress = aws.Bool(v.(bool))
|
||||
}
|
||||
|
||||
if v, ok := d.GetOk("private_ip"); ok {
|
||||
ni.PrivateIpAddress = aws.String(v.(string))
|
||||
}
|
||||
|
@ -1546,14 +1518,9 @@ func buildAwsInstanceOpts(
|
|||
Name: aws.String(d.Get("iam_instance_profile").(string)),
|
||||
}
|
||||
|
||||
userData := d.Get("user_data").(string)
|
||||
userDataBase64 := d.Get("user_data_base64").(string)
|
||||
user_data := d.Get("user_data").(string)
|
||||
|
||||
if userData != "" {
|
||||
opts.UserData64 = aws.String(base64Encode([]byte(userData)))
|
||||
} else if userDataBase64 != "" {
|
||||
opts.UserData64 = aws.String(userDataBase64)
|
||||
}
|
||||
opts.UserData64 = aws.String(base64Encode([]byte(user_data)))
|
||||
|
||||
// check for non-default Subnet, and cast it to a String
|
||||
subnet, hasSubnet := d.GetOk("subnet_id")
|
||||
|
@ -1575,6 +1542,8 @@ func buildAwsInstanceOpts(
|
|||
opts.Placement.Tenancy = aws.String(v)
|
||||
}
|
||||
|
||||
associatePublicIPAddress := d.Get("associate_public_ip_address").(bool)
|
||||
|
||||
var groups []*string
|
||||
if v := d.Get("security_groups"); v != nil {
|
||||
// Security group names.
|
||||
|
@ -1593,7 +1562,7 @@ func buildAwsInstanceOpts(
|
|||
networkInterfaces, interfacesOk := d.GetOk("network_interface")
|
||||
|
||||
// If setting subnet and public address, OR manual network interfaces, populate those now.
|
||||
if hasSubnet || interfacesOk {
|
||||
if hasSubnet && associatePublicIPAddress || interfacesOk {
|
||||
// Otherwise we're attaching (a) network interface(s)
|
||||
opts.NetworkInterfaces = buildNetworkInterfaceOpts(d, groups, networkInterfaces)
|
||||
} else {
|
||||
|
|
33
vendor/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_vpc.go
generated
vendored
33
vendor/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_vpc.go
generated
vendored
|
@ -194,17 +194,27 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error {
|
|||
}
|
||||
}
|
||||
|
||||
resp, err := awsVpcDescribeVpcAttribute("enableDnsSupport", vpcid, conn)
|
||||
// Attributes
|
||||
attribute := "enableDnsSupport"
|
||||
describeAttrOpts := &ec2.DescribeVpcAttributeInput{
|
||||
Attribute: aws.String(attribute),
|
||||
VpcId: aws.String(vpcid),
|
||||
}
|
||||
resp, err := conn.DescribeVpcAttribute(describeAttrOpts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d.Set("enable_dns_support", resp.EnableDnsSupport.Value)
|
||||
|
||||
resp, err = awsVpcDescribeVpcAttribute("enableDnsHostnames", vpcid, conn)
|
||||
d.Set("enable_dns_support", *resp.EnableDnsSupport.Value)
|
||||
attribute = "enableDnsHostnames"
|
||||
describeAttrOpts = &ec2.DescribeVpcAttributeInput{
|
||||
Attribute: &attribute,
|
||||
VpcId: &vpcid,
|
||||
}
|
||||
resp, err = conn.DescribeVpcAttribute(describeAttrOpts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d.Set("enable_dns_hostnames", resp.EnableDnsHostnames.Value)
|
||||
d.Set("enable_dns_hostnames", *resp.EnableDnsHostnames.Value)
|
||||
|
||||
describeClassiclinkOpts := &ec2.DescribeVpcClassicLinkInput{
|
||||
VpcIds: []*string{&vpcid},
|
||||
|
@ -637,16 +647,3 @@ func resourceAwsVpcInstanceImport(
|
|||
d.Set("assign_generated_ipv6_cidr_block", false)
|
||||
return []*schema.ResourceData{d}, nil
|
||||
}
|
||||
|
||||
func awsVpcDescribeVpcAttribute(attribute string, vpcId string, conn *ec2.EC2) (*ec2.DescribeVpcAttributeOutput, error) {
|
||||
describeAttrOpts := &ec2.DescribeVpcAttributeInput{
|
||||
Attribute: aws.String(attribute),
|
||||
VpcId: aws.String(vpcId),
|
||||
}
|
||||
resp, err := conn.DescribeVpcAttribute(describeAttrOpts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
|
|
@ -1820,10 +1820,12 @@
|
|||
"revisionTime": "2016-09-27T10:08:44Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "xG4fC10IB94QTZqilXGPYsuXY4Y=",
|
||||
"checksumSHA1": "UxgAKjDS6mher0PL9dw61QnPQ7w=",
|
||||
"path": "github.com/terraform-providers/terraform-provider-aws/aws",
|
||||
"revision": "09d5c403db49e319daefa1eeaf9265f89c16f633",
|
||||
"revisionTime": "2017-08-10T09:00:58Z"
|
||||
"revision": "4bf6f8f8134705ab3aea5451a186e85c4fb10547",
|
||||
"revisionTime": "2017-08-08T15:30:11Z",
|
||||
"version": "v0.1.4",
|
||||
"versionExact": "v0.1.4"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "R+2QkZ1uCKhGJN7Nak++jdKx59I=",
|
||||
|
|
Loading…
Reference in New Issue