provider/aws: Add agent_version argument to AWS_OPSWORKS_STACK

This commit is contained in:
Justin Clark 2016-05-05 14:56:44 -07:00 committed by Paul Stack
parent 0648941063
commit 380ada1019
2 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,11 @@ func resourceAwsOpsworksStack() *schema.Resource {
Delete: resourceAwsOpsworksStackDelete,
Schema: map[string]*schema.Schema{
"agent_version": &schema.Schema{
Type: schema.TypeString,
Optional: true,
},
"id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
@ -265,6 +270,7 @@ func resourceAwsOpsworksStackRead(d *schema.ResourceData, meta interface{}) erro
}
stack := resp.Stacks[0]
d.Set("agent_version", stack.AgentVersion)
d.Set("name", stack.Name)
d.Set("region", stack.Region)
d.Set("default_instance_profile_arn", stack.DefaultInstanceProfileArn)
@ -397,6 +403,9 @@ func resourceAwsOpsworksStackUpdate(d *schema.ResourceData, meta interface{}) er
Attributes: make(map[string]*string),
CustomCookbooksSource: resourceAwsOpsworksStackCustomCookbooksSource(d),
}
if v, ok := d.GetOk("agent_version"); ok {
req.AgentVersion = aws.String(v.(string))
}
if v, ok := d.GetOk("default_os"); ok {
req.DefaultOs = aws.String(v.(string))
}

View File

@ -37,6 +37,7 @@ The following arguments are supported:
* `service_role_arn` - (Required) The ARN of an IAM role that the OpsWorks service will act as.
* `default_instance_profile_arn` - (Required) The ARN of an IAM Instance Profile that created instances
will have by default.
* `agent_version` - (Optional) If set to `"LATEST"`, OpsWorks will automatically install the latest version.
* `berkshelf_version` - (Optional) If `manage_berkshelf` is enabled, the version of Berkshelf to use.
* `color` - (Optional) Color to paint next to the stack's resources in the OpsWorks console.
* `default_availability_zone` - (Optional) Name of the availability zone where instances will be created