github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/website/source/docs/providers/aws/r/codedeploy_deployment_group.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_codedeploy_deployment_group"
     4  sidebar_current: "docs-aws-resource-codedeploy-deployment-group"
     5  description: |-
     6    Provides a CodeDeploy deployment group.
     7  ---
     8  
     9  # aws\_codedeploy\_deployment\_group
    10  
    11  Provides a CodeDeploy deployment group for an application
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "aws_codedeploy_app" "foo_app" {
    17      name = "foo_app"
    18  }
    19  
    20  resource "aws_iam_role_policy" "foo_policy" {
    21      name = "foo_policy"
    22      role = "${aws_iam_role.foo_role.id}"
    23      policy = <<EOF
    24  {
    25      "Version": "2012-10-17",
    26      "Statement": [
    27          {
    28              "Effect": "Allow",
    29              "Action": [
    30                  "autoscaling:CompleteLifecycleAction",
    31                  "autoscaling:DeleteLifecycleHook",
    32              "autoscaling:DescribeAutoScalingGroups",
    33                  "autoscaling:DescribeLifecycleHooks",
    34                  "autoscaling:PutLifecycleHook",
    35                  "autoscaling:RecordLifecycleActionHeartbeat",
    36                  "ec2:DescribeInstances",
    37                  "ec2:DescribeInstanceStatus",
    38                  "tag:GetTags",
    39              "tag:GetResources"
    40              ],
    41              "Resource": "*"
    42          }
    43      ]
    44  }
    45  EOF
    46  }
    47  
    48  resource "aws_iam_role" "foo_role" {
    49      name = "foo_role"
    50      assume_role_policy = <<EOF
    51  {
    52    "Version": "2012-10-17",
    53    "Statement": [
    54      {
    55        "Sid": "",
    56        "Effect": "Allow",
    57        "Principal": {
    58          "Service": [
    59            "codedeploy.amazonaws.com"
    60          ]
    61        },
    62        "Action": "sts:AssumeRole"
    63      }
    64    ]
    65  }
    66  EOF
    67  }
    68  
    69  resource "aws_codedeploy_deployment_group" "foo" {
    70      app_name = "${aws_codedeploy_app.foo_app.name}"
    71      deployment_group_name = "bar"
    72      service_role_arn = "${aws_iam_role.foo_role.arn}"
    73      ec2_tag_filter {
    74          key = "filterkey"
    75          type = "KEY_AND_VALUE"
    76          value = "filtervalue"
    77      }
    78  }
    79  ```
    80  
    81  ## Argument Reference
    82  
    83  The following arguments are supported:
    84  
    85  * `app_name` - (Required) The name of the application.
    86  * `deployment_group_name` - (Required) The name of the deployment group.
    87  * `service_role_arn` - (Required) The service role ARN that allows deployments.
    88  * `autoscaling_groups` - (Optional) Autoscaling groups associated with the deployment group.
    89  * `deployment_config_name` - (Optional) The name of the group's deployment config. The default is "CodeDeployDefault.OneAtATime".
    90  * `ec2_tag_filter` - (Optional) Tag filters associated with the group. See the AWS docs for details.
    91  * `on_premises_instance_tag_filter" - (Optional) On premise tag filters associated with the group. See the AWS docs for details.
    92  
    93  Both ec2_tag_filter and on_premises_tag_filter blocks support the following:
    94  
    95  * `key` - (Optional) The key of the tag filter.
    96  * `type` - (Optional) The type of the tag filter, either KEY_ONLY, VALUE_ONLY, or KEY_AND_VALUE.
    97  * `value` - (Optional) The value of the tag filter.
    98  
    99  ## Attributes Reference
   100  
   101  The following attributes are exported:
   102  
   103  * `id` - The deployment group's ID.
   104  * `app_name` - The group's assigned application.
   105  * `deployment_group_name` - The group's name.
   106  * `service_role_arn` - The group's service role ARN.
   107  * `autoscaling_groups` - The autoscaling groups associated with the deployment group.
   108  * `deployment_config_name` - The name of the group's deployment config.