Codeploy deployment group app_name instead of application_name.
The corresponding resource is called aws_codeploy_app, so for consistency we'll name the attribute app_name instead of application_name.
This commit is contained in:
parent
0952505358
commit
dd56b39e0c
|
@ -23,7 +23,7 @@ func resourceAwsCodeDeployDeploymentGroup() *schema.Resource {
|
||||||
Delete: resourceAwsCodeDeployDeploymentGroupDelete,
|
Delete: resourceAwsCodeDeployDeploymentGroupDelete,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"application_name": &schema.Schema{
|
"app_name": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||||
|
@ -132,7 +132,7 @@ func resourceAwsCodeDeployDeploymentGroup() *schema.Resource {
|
||||||
func resourceAwsCodeDeployDeploymentGroupCreate(d *schema.ResourceData, meta interface{}) error {
|
func resourceAwsCodeDeployDeploymentGroupCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
conn := meta.(*AWSClient).codedeployconn
|
conn := meta.(*AWSClient).codedeployconn
|
||||||
|
|
||||||
application := d.Get("application_name").(string)
|
application := d.Get("app_name").(string)
|
||||||
deploymentGroup := d.Get("deployment_group_name").(string)
|
deploymentGroup := d.Get("deployment_group_name").(string)
|
||||||
|
|
||||||
input := codedeploy.CreateDeploymentGroupInput{
|
input := codedeploy.CreateDeploymentGroupInput{
|
||||||
|
@ -189,14 +189,14 @@ func resourceAwsCodeDeployDeploymentGroupRead(d *schema.ResourceData, meta inter
|
||||||
|
|
||||||
log.Printf("[DEBUG] Reading CodeDeploy DeploymentGroup %s", d.Id())
|
log.Printf("[DEBUG] Reading CodeDeploy DeploymentGroup %s", d.Id())
|
||||||
resp, err := conn.GetDeploymentGroup(&codedeploy.GetDeploymentGroupInput{
|
resp, err := conn.GetDeploymentGroup(&codedeploy.GetDeploymentGroupInput{
|
||||||
ApplicationName: aws.String(d.Get("application_name").(string)),
|
ApplicationName: aws.String(d.Get("app_name").(string)),
|
||||||
DeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)),
|
DeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
d.Set("application_name", *resp.DeploymentGroupInfo.ApplicationName)
|
d.Set("app_name", *resp.DeploymentGroupInfo.ApplicationName)
|
||||||
d.Set("autoscaling_groups", resp.DeploymentGroupInfo.AutoScalingGroups)
|
d.Set("autoscaling_groups", resp.DeploymentGroupInfo.AutoScalingGroups)
|
||||||
d.Set("deployment_config_name", *resp.DeploymentGroupInfo.DeploymentConfigName)
|
d.Set("deployment_config_name", *resp.DeploymentGroupInfo.DeploymentConfigName)
|
||||||
d.Set("deployment_group_name", *resp.DeploymentGroupInfo.DeploymentGroupName)
|
d.Set("deployment_group_name", *resp.DeploymentGroupInfo.DeploymentGroupName)
|
||||||
|
@ -215,7 +215,7 @@ func resourceAwsCodeDeployDeploymentGroupUpdate(d *schema.ResourceData, meta int
|
||||||
conn := meta.(*AWSClient).codedeployconn
|
conn := meta.(*AWSClient).codedeployconn
|
||||||
|
|
||||||
input := codedeploy.UpdateDeploymentGroupInput{
|
input := codedeploy.UpdateDeploymentGroupInput{
|
||||||
ApplicationName: aws.String(d.Get("application_name").(string)),
|
ApplicationName: aws.String(d.Get("app_name").(string)),
|
||||||
CurrentDeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)),
|
CurrentDeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ func resourceAwsCodeDeployDeploymentGroupDelete(d *schema.ResourceData, meta int
|
||||||
|
|
||||||
log.Printf("[DEBUG] Deleting CodeDeploy DeploymentGroup %s", d.Id())
|
log.Printf("[DEBUG] Deleting CodeDeploy DeploymentGroup %s", d.Id())
|
||||||
_, err := conn.DeleteDeploymentGroup(&codedeploy.DeleteDeploymentGroupInput{
|
_, err := conn.DeleteDeploymentGroup(&codedeploy.DeleteDeploymentGroupInput{
|
||||||
ApplicationName: aws.String(d.Get("application_name").(string)),
|
ApplicationName: aws.String(d.Get("app_name").(string)),
|
||||||
DeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)),
|
DeploymentGroupName: aws.String(d.Get("deployment_group_name").(string)),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -41,7 +41,7 @@ func testAccCheckAWSCodeDeployDeploymentGroupDestroy(s *terraform.State) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := conn.GetDeploymentGroup(&codedeploy.GetDeploymentGroupInput{
|
resp, err := conn.GetDeploymentGroup(&codedeploy.GetDeploymentGroupInput{
|
||||||
ApplicationName: aws.String(rs.Primary.Attributes["application_name"]),
|
ApplicationName: aws.String(rs.Primary.Attributes["app_name"]),
|
||||||
DeploymentGroupName: aws.String(rs.Primary.Attributes["deployment_group_name"]),
|
DeploymentGroupName: aws.String(rs.Primary.Attributes["deployment_group_name"]),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_codedeploy_deployment_group" "foo" {
|
resource "aws_codedeploy_deployment_group" "foo" {
|
||||||
application_name = "${aws_codedeploy_app.foo_app.name}"
|
app_name = "${aws_codedeploy_app.foo_app.name}"
|
||||||
deployment_group_name = "foo"
|
deployment_group_name = "foo"
|
||||||
service_role_arn = "${aws_iam_role.foo_role.arn}"
|
service_role_arn = "${aws_iam_role.foo_role.arn}"
|
||||||
ec2_tag_filter {
|
ec2_tag_filter {
|
||||||
|
@ -188,7 +188,7 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_codedeploy_deployment_group" "foo" {
|
resource "aws_codedeploy_deployment_group" "foo" {
|
||||||
application_name = "${aws_codedeploy_app.foo_app.name}"
|
app_name = "${aws_codedeploy_app.foo_app.name}"
|
||||||
deployment_group_name = "bar"
|
deployment_group_name = "bar"
|
||||||
service_role_arn = "${aws_iam_role.foo_role.arn}"
|
service_role_arn = "${aws_iam_role.foo_role.arn}"
|
||||||
ec2_tag_filter {
|
ec2_tag_filter {
|
||||||
|
|
|
@ -67,7 +67,7 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_codedeploy_deployment_group" "foo" {
|
resource "aws_codedeploy_deployment_group" "foo" {
|
||||||
application_name = "${aws_codedeploy_app.foo_app.name}"
|
app_name = "${aws_codedeploy_app.foo_app.name}"
|
||||||
deployment_group_name = "bar"
|
deployment_group_name = "bar"
|
||||||
service_role_arn = "${aws_iam_role.foo_role.arn}"
|
service_role_arn = "${aws_iam_role.foo_role.arn}"
|
||||||
ec2_tag_filter {
|
ec2_tag_filter {
|
||||||
|
@ -82,7 +82,7 @@ resource "aws_codedeploy_deployment_group" "foo" {
|
||||||
|
|
||||||
The following arguments are supported:
|
The following arguments are supported:
|
||||||
|
|
||||||
* `application_name` - (Required) The name of the application.
|
* `app_name` - (Required) The name of the application.
|
||||||
* `deployment_group_name` - (Required) The name of the deployment group.
|
* `deployment_group_name` - (Required) The name of the deployment group.
|
||||||
* `service_role_arn` - (Required) The service role ARN that allows deployments.
|
* `service_role_arn` - (Required) The service role ARN that allows deployments.
|
||||||
* `autoscaling_groups` - (Optional) Autoscaling groups associated with the deployment group.
|
* `autoscaling_groups` - (Optional) Autoscaling groups associated with the deployment group.
|
||||||
|
@ -101,7 +101,7 @@ Both ec2_tag_filter and on_premises_tag_filter blocks support the following:
|
||||||
The following attributes are exported:
|
The following attributes are exported:
|
||||||
|
|
||||||
* `id` - The deployment group's ID.
|
* `id` - The deployment group's ID.
|
||||||
* `application_name` - The group's assigned application.
|
* `app_name` - The group's assigned application.
|
||||||
* `deployment_group_name` - The group's name.
|
* `deployment_group_name` - The group's name.
|
||||||
* `service_role_arn` - The group's service role ARN.
|
* `service_role_arn` - The group's service role ARN.
|
||||||
* `autoscaling_groups` - The autoscaling groups associated with the deployment group.
|
* `autoscaling_groups` - The autoscaling groups associated with the deployment group.
|
||||||
|
|
Loading…
Reference in New Issue