-
Notifications
You must be signed in to change notification settings - Fork 59
feat: add Oracle Cloud Infrastructure (OCI) template (#201) #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@matifali I have attached a terminal demo proving my OCI template is valid, documented, and pushed to GitHub; due to local Coder provisioner issues, I’m unable to record a full UI workspace creation—could a reviewer please test the import and workspace creation? Thank you! |
Rather than a demo of you running the terraform initialization and validation, it would be better to take this template and push it to your coder deployment, in which you could show a workspace being created from this template. |
7281518
to
c129148
Compare
c129148
to
31c802f
Compare
@aybanda Any update on this? |
…arameter - Fix duplicate option values for VM.Standard.A1.Flex and VM.Standard.E3.Flex shapes - Add dynamic shape configuration handling for flexible shapes - Implement proper OCPU and memory parsing from parameter values - Ensure unique option values while maintaining descriptive names - Template now passes terraform validation without errors
Demo Status Update@DevelopmentCats @matifali I wanted to show you guys the OCI template working in a real Coder deployment, but I'm having trouble with my OCI account. So I put together a different kind of demo that shows what I've built. What I've DoneI've created a complete OCI template that:
The template is about 500 lines of Terraform config plus comprehensive docs. I've tested it locally and it validates perfectly - no syntax errors or configuration issues. The Demo VideoSince I can't get OCI access, I recorded a walkthrough showing:
What I NeedCould someone with an OCI account please test this template? I'd love to see it actually create a workspace, but I just can't get past Oracle's signup process. The template URL is: You'd just need to:
ConclusionI think this template is solid and ready to go. It follows all the Coder patterns I've seen in other templates, has proper error handling, and includes everything needed for production use. The only missing piece is someone with OCI access to give it a real test. If no one can test it right now, I'm happy to provide more detailed code walkthroughs or make any adjustments needed. Thanks for taking a look! Untitled.mov |
9d58583
to
cea6770
Compare
Im signing up for an account now. Ill update and let you know how it goes |
@aybanda its taking a bit for me to get the activation email for the account. Can you also take a look at your changes in the PR. you currently have changes made to other coder modules included in this PR which we do not want. |
cea6770
to
9bc4073
Compare
I've fixed it – the PR now only includes the intended changes. |
.icons/oci.svg
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an aws logo not an oci logo. But Oracle does have complicated legal standards for logo usage rights.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can just go ahead and use the OCI logo if you can go ahead and update this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot use official OCI logo due to their trademark/licensing requirements, so removed icon reference entirely to avoid issues further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified this with out product team, and you can go ahead and add it back.
.icons/oci.svg
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely not the Oracle Logo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be the logo that OCI is using which will probably work better for the icon anyways
https://upload.wikimedia.org/wikipedia/commons/e/e1/Oracle_Corporation_logo.svg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aybanda, please update the logo as per recommendation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not work for me. Even after resolving some of the issues I described above. I got
2025-09-04 09:02:10.837+05:00 Error: 401-NotAuthenticated, The required information to complete authentication was not provided or was incorrect.
Suggestion: Please retry or contact support for help with service: Identity Compartments
Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/identity_compartments
API Reference: https://docs.oracle.com/iaas/api/#/en/identity/20160918/Compartment/ListCompartments
Request Target: GET https://identity.us-ashburn-1.oci.oraclecloud.com/20160918/compartments?accessLevel=ACCESSIBLE&compartmentId=cid1.tenancy.oc1..aaaaaaaaigxlcgiui3lvzfa7z4cjcifkzomdsi45mt236ntq3btihom2bsiq&lifecycleState=ACTIVE
Provider version: 7.16.0, released on 2025-08-27. This provider is 1 Update(s) behind to current.
Service: Identity Compartments
Operation Name: ListCompartments
OPC request ID: 412635a3e275e2ab4d56c95ab1c852c0/9F233F34C3152E80330CC4B81E0CB733/423339ECDF1E0CF69EF4F2C31CDEBAF5
2025-09-04 09:02:10.837+05:00 on main.tf line 218, in data "oci_identity_compartments" "compartments":
2025-09-04 09:02:10.837+05:00 218: data "oci_identity_compartments" "compartments" {
2025-09-04 09:02:10.837+05:00
2025-09-04 09:02:10.837+05:00
2025-09-04 09:02:10.842+05:00 Error: 401-NotAuthenticated, The required information to complete authentication was not provided or was incorrect.
Suggestion: Please retry or contact support for help with service: Identity Availability Domains
Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/identity_availability_domains
API Reference: https://docs.oracle.com/iaas/api/#/en/identity/20160918/AvailabilityDomain/ListAvailabilityDomains
Request Target: GET https://identity.us-ashburn-1.oci.oraclecloud.com/20160918/availabilityDomains?compartmentId=cid1.tenancy.oc1..aaaaaaaaigxlcgiui3lvzfa7z4cjcifkzomdsi45mt236ntq3btihom2bsiq
Provider version: 7.16.0, released on 2025-08-27. This provider is 1 Update(s) behind to current.
Service: Identity Availability Domains
Operation Name: ListAvailabilityDomains
OPC request ID: b46cad642483ec528dad51f44d29a690/35273924FC2FBCC02B385D0F6C01992F/60E8E5DCDF4BF2CC7BA82CFB352F9F28
2025-09-04 09:02:10.842+05:00 on main.tf line 438, in data "oci_identity_availability_domains" "ads":
2025-09-04 09:02:10.842+05:00 438: data "oci_identity_availability_domains" "ads" {
2025-09-04 09:02:10.842+05:00
2025-09-04 09:02:10.842+05:00
2025-09-04 09:02:10.852+05:00 Error: 401-NotAuthenticated, The required information to complete authentication was not provided or was incorrect.
Suggestion: Please retry or contact support for help with service: Core Images
Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/core_images
API Reference: https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Image/ListImages
Request Target: GET https://iaas.us-ashburn-1.oraclecloud.com/20160918/images?compartmentId=cid1.tenancy.oc1..aaaaaaaaigxlcgiui3lvzfa7z4cjcifkzomdsi45mt236ntq3btihom2bsiq&lifecycleState=AVAILABLE&operatingSystem=Canonical+Ubuntu&operatingSystemVersion=22.04&sortBy=TIMECREATED&sortOrder=DESC
Provider version: 7.16.0, released on 2025-08-27. This provider is 1 Update(s) behind to current.
Service: Core Images
Operation Name: ListImages
OPC request ID: ebc2170c48cc50e78352b08bf10404a7/CB33D3262B662EC71790B49EA6A05EFC/76FEE4481D6DD9BFA0E1964B08F00AC9
2025-09-04 09:02:10.852+05:00 on main.tf line 225, in data "oci_core_images" "ubuntu":
2025-09-04 09:02:10.852+05:00 225: data "oci_core_images" "ubuntu" {
2025-09-04 09:02:10.852+05:00
2025-09-04 09:02:10.853+05:00
=== ✔ Detecting persistent resources [12054ms]
==> ⧗ Cleaning Up
=== ✘ Cleaning Up [17ms]
=== ✘ Cleaning Up [628ms]
Encountered an error running "coder templates push", see "coder templates push --help" for more information
error: template import provision for start: terraform plan: exit status 1
.icons/oci.svg
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aybanda, please update the logo as per recommendation.
This template assumes that coderd is run in an environment that is authenticated with Oracle Cloud Infrastructure. The recommended authentication methods are: | ||
|
||
1. **Instance Principal** (Recommended for production): Run Coder on an OCI instance with proper IAM policies | ||
2. **API Key**: Set environment variables `OCI_TENANCY_OCID`, `OCI_USER_OCID`, `OCI_FINGERPRINT`, and `OCI_PRIVATE_KEY_PATH` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user also needs to mount the key file in the coder server/provisioner container.
variable "ssh_public_key" { | ||
description = "SSH public key for the instance" | ||
type = string | ||
default = "" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be required as Coder handles networking and authentication through the Coder agent.
variable "compartment_ocid" { | ||
description = "The OCID of the compartment to create resources in" | ||
type = string | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this optional and default to the root compartment, which is equivalent to the tenancy OCID. https://docs.oracle.com/en-us/iaas/Content/dev/terraform/configuring.htm#env-export-source
name = "instance_shape" | ||
display_name = "Instance Shape" | ||
description = "What instance shape should your workspace use?" | ||
default = "VM.Standard.A1.Flex" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default should be one of the options.
2025-09-03 11:50:24.065+05:00 Error: Default value must be a valid option
2025-09-03 11:50:24.066+05:00 on main.tf line 126, in data "coder_parameter" "instance_shape":
2025-09-03 11:50:24.066+05:00 126: default = "VM.Standard.A1.Flex"
2025-09-03 11:50:24.066+05:00
2025-09-03 11:50:24.066+05:00 the value "VM.Standard.A1.Flex" must be defined as one of options
2025-09-03 11:50:24.074+05:00 Error: can not create client, bad configuration: did not find a proper configuration for tenancy
2025-09-03 11:50:24.074+05:00 on main.tf line 204, in provider "oci":
2025-09-03 11:50:24.074+05:00 204: provider "oci" {
2025-09-03 11:50:24.074+05:00
2025-09-03 11:50:24.074+05:00
…tenancy; fix instance_shape default; use effective compartment for image/AD; update OCI logo to official wordmark
…TF_VAR guidance to avoid 401s
Closes #201
Description
This PR adds a new Oracle Cloud Infrastructure (OCI) Linux template for provisioning Coder workspaces. The template includes compute instances, networking (VCN, subnet, internet gateway), and storage configuration as requested in issue #201.
Type of Change
Module Information
Path:
registry/aybanda/templates/oci-linux
New version:
v1.0.0
Breaking change: [ ] Yes [x] No
Testing & Validation
bun test
)bun run fmt
)demo.mov
Related Issues
Closes #201 - Add Oracle Cloud Infrastructure (OCI) template example
/claim #201