Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Enable creation of resource under non-default container path #67

Open
scross01 opened this issue Aug 15, 2017 · 2 comments
Open

Enable creation of resource under non-default container path #67

scross01 opened this issue Aug 15, 2017 · 2 comments

Comments

@scross01
Copy link
Contributor

Terraform Version

terraform v0.10.0
opc provider v0.1.2

Affected Resource(s)

All resources

The opc provider currently creates all resources under the users specific container e.g. for a user with ID user@example.com all resources will be created under /Compute-mydomain/user@example.com. This matches the compute console UI behavior, however using the APIs it's possible to create resources under a custom container. Terraform provider also need to support this behavior

e.g. explicitly setting the name of the resource to name = "/Compute-mydomain/mycontainer/myresource" should create the resource under the specifically named container path. Omitting the fully qualified container path would revert to using the default user id based container.

Example config:

provider "opc" {
  user            = "${var.user}"
  password        = "${var.password}"
  identity_domain = "${var.domain}"
  endpoint        = "${var.endpoint}"
}

resource "opc_compute_storage_volume" "volume1" {
  size             = "12"
  description      = "Example bootable storage volume"
  name             = "/Compute-${var.domain}/mycontainer/boot-from-storage-example"
  bootable         = true
  image_list       = "/oracle/public/OL_6.8_UEKR3_x86_64"
  image_list_entry = 3
}

resource "opc_compute_instance" "instance1" {
  name  = "/Compute-${var.domain}/mycontainer/boot-from-storage-instance1"
  label = "Example instance with bootable storage"
  shape = "oc3"

  storage {
    index  = 1
    volume = "${opc_compute_storage_volume.volume1.name}"
  }

  boot_order = [1]
}
@scross01 scross01 changed the title Enable creation of resource under non-default container Enable creation of resource under non-default container path Aug 15, 2017
@scross01
Copy link
Contributor Author

scross01 commented Aug 15, 2017

For discussion: alternative could be to explicitly add container_path as an optional attribute to all resources. Plus all resources should probably have separate attributes to distinguish between the fully qualified name /Compute-mydomain/mycontainer/myresourcename and just the name part myresourcename

@cameronsenese
Copy link

For discussion: alternative could be to explicitly add container_path as an optional attribute to all resources. Plus all resources should probably have separate attributes to distinguish between the fully qualified name /Compute-mydomain/mycontainer/myresourcename and just the name part myresourcename

This would be excellent. Classic IaaS can recreate (delete then create) instances in certain circumstances where an object is provisioned by one user (using user's specific container), and is then updated by another - for example attaching an additional storage volume to a compute instance. Ability to provision resources using custom/generic resource containers would be a great help in avoiding this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants