Difference between revisions of "Terraform resource: aws appautoscaling target"

From wikieduonline
Jump to navigation Jump to search
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
*<code>aws_appautoscaling_target</code> <ref>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target</ref>
+
<code>aws_appautoscaling_target</code> resource <ref>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target</ref>
  
===ECS Example===
+
== ECS Example ==
<pre>resource "aws_appautoscaling_target" "ecs_target" {
+
resource "aws_appautoscaling_target" "ecs_target" {
  max_capacity      = 4
+
  [[max_capacity]]       = 4
  min_capacity      = 1
+
  min_capacity      = 1
  resource_id        = "service/${aws_ecs_cluster.example.name}/${aws_ecs_service.example.name}"
+
  [[resource_id]]       = "service/${aws_ecs_cluster.example.name}/${aws_ecs_service.example.name}"
  scalable_dimension = "ecs:service:DesiredCount"
+
  [[scalable_dimension]] = "[[ecs:service:DesiredCount]]"
   service_namespace  = "ecs"
+
  service_namespace  = "ecs"
}</pre>
+
}
 +
 
 +
== DynamoDB index official example ==
 +
resource "aws_appautoscaling_target" "dynamodb_index_read_target" {
 +
  max_capacity      = 100
 +
  min_capacity      = 5
 +
  resource_id        = "table/${aws_dynamodb_table.example.name}/index/${var.index_name}"
 +
  [[scalable_dimension]] = "[[dynamodb:]]index:ReadCapacityUnits"
 +
  service_namespace  = "dynamodb"
 +
}
 +
 
 +
== DynamoDB Table official example ==
 +
resource "aws_appautoscaling_target" "dynamodb_table_read_target" {
 +
  max_capacity      = 100
 +
  min_capacity      = 5
 +
  resource_id        = "table/${aws_dynamodb_table.example.name}"
 +
  scalable_dimension = "dynamodb:table:ReadCapacityUnits"
 +
   service_namespace  = "dynamodb"
 +
}
 +
 
 +
== Related ==
 +
* <code>[[aws_appautoscaling_policy]]</code>
 +
* <code>[[aws_autoscaling_group]]</code>
  
 
== See also ==
 
== See also ==
 +
* {{tf autoscaling}}
 
* {{terraform aws resources}}
 
* {{terraform aws resources}}
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]
 
[[Category:AWS]]
 
[[Category:AWS]]

Latest revision as of 08:46, 4 July 2023

aws_appautoscaling_target resource [1]

ECS Example[edit]

resource "aws_appautoscaling_target" "ecs_target" {
  max_capacity       = 4
  min_capacity       = 1
  resource_id        = "service/${aws_ecs_cluster.example.name}/${aws_ecs_service.example.name}"
  scalable_dimension = "ecs:service:DesiredCount"
  service_namespace  = "ecs"
}

DynamoDB index official example[edit]

resource "aws_appautoscaling_target" "dynamodb_index_read_target" {
 max_capacity       = 100
 min_capacity       = 5
 resource_id        = "table/${aws_dynamodb_table.example.name}/index/${var.index_name}"
 scalable_dimension = "dynamodb:index:ReadCapacityUnits"
 service_namespace  = "dynamodb"
}

DynamoDB Table official example[edit]

resource "aws_appautoscaling_target" "dynamodb_table_read_target" {
 max_capacity       = 100
 min_capacity       = 5
 resource_id        = "table/${aws_dynamodb_table.example.name}"
 scalable_dimension = "dynamodb:table:ReadCapacityUnits"
 service_namespace  = "dynamodb"
}

Related[edit]

See also[edit]

  • https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target
  • Advertising: