Terraform: ability to configure OpsWorks Stacks API endpoint

Created on 9 Feb 2017  ยท  10Comments  ยท  Source: hashicorp/terraform

Hi There

Description

The API endpoint seems to be hard coded to us-east-1 which is obsolete
https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/config.go#L305

OpsWorks is available in more than just one region: http://docs.aws.amazon.com/general/latest/gr/rande.html#opsworks_region

A similar situation has already been discussed in the forum discussion: https://groups.google.com/forum/#!msg/terraform-tool/GOckyBRzX2Y/_Bcy1x9ZAQAJ

Terraform Version

v0.8.6

Steps to reproduce:

  1. create Opsworks stack and assign it to VPC and region
resource "aws_opsworks_stack" "myStack" {
  name                         = "${var.prefix}_myStack"
  region                       = "${lookup(var.aws_region, var.aws_account)}"
  default_availability_zone    = "${element(var.availability_zones, count.index)}"
  color                        = "${lookup(var.myStack, var.prefix)}"
  default_instance_profile_arn = "${aws_iam_instance_profile.opsworks-instance.arn}"
  service_role_arn             = "${aws_iam_role.opsworks-instance.arn}"
  default_os                   = "${var.myStack["default_os"]}"
  vpc_id                       = "${aws_vpc.vpc.id}"
  default_subnet_id            = "${element(aws_subnet.private.*.id, count.index)}"

  # Chef
  configuration_manager_version = "${var.myStack["chef_version"]}"
  manage_berkshelf              = true
  use_custom_cookbooks          = true

  # Cookbooks
  custom_cookbooks_source = {
    type = "${var.myStack["cookbooks_source_type"]}"
    url  = "${var.myStack["cookbooks_source_url"]}"
    username = "${var.aws_access_key}"
    password = "${var.aws_secret_key}"
  }
}

  1. Apply changes and look at the advanced options for the stack

API endpoint region: us-east-1 (classic)

It does not honour the settings of VPC, region nor default_availability_zone

bug provideaws

Most helpful comment

The options in the UI for the API endpoint region are either classic or regional. It is a new feature and I feel it needs to be incorporated. terraform should give the option to at least override the default... perhaps something

resource "aws_opsworks_stack" "myStack" {
  name          = "myStack"
  api_endpoint  = "regional" | "classic"
}

All 10 comments

Did you meant "hard coded to us-east-1"?, I'm having this problem as well with their "Integratoin & services" for opsworks, can only trigger deployment to stacks that are configured withing that region.

thanks...yes I meant "us-east-1"

Changing this so it respects the region setting in the provider is possible, but would be a breaking change for anyone who has been depending on this overridden region.

It feels like something we could deal with via a compatibility note on 0.9, if this could get fixed fast enough for that.

The options in the UI for the API endpoint region are either classic or regional. It is a new feature and I feel it needs to be incorporated. terraform should give the option to at least override the default... perhaps something

resource "aws_opsworks_stack" "myStack" {
  name          = "myStack"
  api_endpoint  = "regional" | "classic"
}

any update on this... is anything happening?

We just encountered this limitation. If this could be configured through the already provided region instead of having to provide an endpoint, it would be great!

Here's the list of all available endpoints:
http://docs.aws.amazon.com/opsworks/latest/APIReference/Welcome.html

Changing this setting will require a re-creation of the stack resource as it cannot be modified.

@apparentlymart @grubernaut
For me and others this issue is a blocker... Is it being fixed any time soon?

Unfortunately, this change fixes things using the regional endpoint, but broke things for people using the classic endpoint. Would it be possible to do something like suggested in https://github.com/hashicorp/terraform/issues/11824#issuecomment-278928396 ?

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings