hashicorp / terraform-provider-awscc

Terraform AWS Cloud Control provider
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs
Mozilla Public License 2.0
263 stars 121 forks source link

Support per-resource, per-operation timeout values #40

Open ewbankkit opened 3 years ago

ewbankkit commented 3 years ago

Description

Relates https://github.com/hashicorp/terraform-plugin-framework/issues/68.

As of v0.1.0 terraform-plugin-framework does not support per-resource, per-operation timeouts. Once upstream support is added, enhance this provider. In the meantime, ensure that the Cloud API waiter timeout values are high enough to cover all supported resource operations.

Definition of Done

breathingdust commented 3 years ago

@breathingdust to ask CloudAPI team if this could be surfaced in the schema

ewbankkit commented 3 years ago

From Patrick:

We do have a maximum stabilization timeout that's documented in the schema as timeoutInMinutes, with a default value of 120. The property is documented here, although it doesn't list the default (which we'll need to get added to the public docs).

For example, here's an excerpt from the AWS::ECS::Service schema:

"handlers" : {
    "create" : {
      "permissions" : [ "ecs:CreateService", "ecs:DescribeServices", "iam:PassRole" ],
      "timeoutInMinutes" : 180
    },
    "read" : {
      "permissions" : [ "ecs:DescribeServices" ]
    },
    "update" : {
      "permissions" : [ "ecs:DescribeServices", "ecs:ListTagsForResource", "ecs:TagResource", "ecs:UntagResource", "ecs:UpdateService" ],
      "timeoutInMinutes" : 180
    },
    "delete" : {
      "permissions" : [ "ecs:DeleteService", "ecs:DescribeServices" ],
      "timeoutInMinutes" : 30
    },
    "list" : {
      "permissions" : [ "ecs:DescribeServices", "ecs:ListClusters", "ecs:ListServices" ]
    }
  }

Until the Plugin Framework supports the ability for the practitioner to specify custom timeouts we should use the schema's value as the default.

ewbankkit commented 3 years ago

For v0.1.0 we will have operations timeout values as specified in the CloudFormation schema (with 120 minute default values). We require Plugin Framework changes to support practitioner-specified custom timeouts.