You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API Gateway provides the ability to [enable CloudWatch API logging](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html). To manage the CloudWatch Log Group when this feature is enabled, the [`aws_cloudwatch_log_group` resource](/docs/providers/aws/r/cloudwatch_log_group.html) can be used where the name matches the API Gateway naming convention. If the CloudWatch Log Group previously exists, the [`aws_cloudwatch_log_group` resource can be imported into Terraform](/docs/providers/aws/r/cloudwatch_log_group.html#import) as a one time operation and recreation of the environment can occur without import.
75
75
76
-
-> The below configuration uses [`depends_on`](https://www.terraform.io/docs/configuration/meta-arguments/depends_on.html) to prevent ordering issues with API Gateway automatically creating the log group first and a variable for naming consistency. Other ordering and naming methodologies may be more appropriate for your environment.
76
+
-> The below configuration uses [`depends_on`](https://www.terraform.io/language/meta-arguments/depends_on) to prevent ordering issues with API Gateway automatically creating the log group first and a variable for naming consistency. Other ordering and naming methodologies may be more appropriate for your environment.
77
77
78
78
```terraform
79
79
variable "stage_name" {
@@ -106,24 +106,29 @@ The following arguments are supported:
106
106
*`rest_api_id` - (Required) The ID of the associated REST API
107
107
*`stage_name` - (Required) The name of the stage
108
108
*`deployment_id` - (Required) The ID of the deployment that the stage points to
109
-
*`access_log_settings` - (Optional) Enables access logs for the API stage. Detailed below.
109
+
*`access_log_settings` - (Optional) Enables access logs for the API stage. See [Access Log Settings](#access-log-settings) below.
110
110
*`cache_cluster_enabled` - (Optional) Specifies whether a cache cluster is enabled for the stage
111
111
*`cache_cluster_size` - (Optional) The size of the cache cluster for the stage, if enabled. Allowed values include `0.5`, `1.6`, `6.1`, `13.5`, `28.4`, `58.2`, `118` and `237`.
112
+
*`canary_settings` - (Optional) Configuration settings of a canary deployment. See [Canary Settings](#canary-settings) below.
112
113
*`client_certificate_id` - (Optional) The identifier of a client certificate for the stage.
113
-
*`description` - (Optional) The description of the stage
114
+
*`description` - (Optional) The description of the stage.
114
115
*`documentation_version` - (Optional) The version of the associated API documentation
115
116
*`variables` - (Optional) A map that defines the stage variables
116
117
*`tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
117
118
*`xray_tracing_enabled` - (Optional) Whether active tracing with X-ray is enabled. Defaults to `false`.
118
119
119
-
### Nested Blocks
120
-
121
-
#### `access_log_settings`
120
+
### Access Log Settings
122
121
123
122
*`destination_arn` - (Required) The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with `amazon-apigateway-`. Automatically removes trailing `:*` if present.
124
123
*`format` - (Required) The formatting and values recorded in the logs.
125
124
For more information on configuring the log format rules visit the AWS [documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html)
126
125
126
+
### Canary Settings
127
+
128
+
*`percent_traffic` - (Optional) The percent `0.0` - `100.0` of traffic to divert to the canary deployment.
129
+
*`stage_variable_overrides` - (Optional) A map of overridden stage `variables` (including new variables) for the canary deployment.
130
+
*`use_stage_cache` - (Optional) Whether the canary deployment uses the stage cache. Defaults to false.
131
+
127
132
## Attributes Reference
128
133
129
134
In addition to all arguments above, the following attributes are exported:
0 commit comments