Skip to content
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

Add Astro Scenario Examples #47

Conversation

ichung08
Copy link
Collaborator

@ichung08 ichung08 commented May 1, 2024

Description

We want to replicate the standard 3 Astro scenarios in terraform as examples users can reference and run.

Scenarios:

Workspace Per Environment

  • Dev workspace
    • Team 1 Dev Deployment
    • Team 2 Dev Deployment
    • Team 3 Dev Deployment
  • Staging Workspace
    • Team 1 Staging Deployment
    • Team 2 Staging Deployment
    • Team 3 Staging Deployment
  • Prod Workspace
    • Team 1 Prod Deployment
    • Team 2 Prod Deployment
    • Team 3 Prod Deployment

Workspace Per Team

  • Team 1 Workspace
    • Dev Deployment
    • Stage Deployment
    • Prod Deployment
  • Team 2
    • Dev Deployment
    • Stage Deployment
    • Prod Deployment
  • Team 3
    • Dev Deployment
    • Stage Deployment
    • Prod Deployment

Workspace Per Team and Per Environment

  • Team 1 workspace non-prod
    • Team 1 dev deployment
    • Team 1 staging deployment
  • Team 1 workspace prod
    • Team 1 prod deployment
  • Team 2 workspace non-prod
    • Team 2 dev deployment
    • Team 2 staging deployment
  • Team 2 workspace prod
    • Team 2 prod deployment
  • Team 3 workspace non-prod
    • Team 3 dev deployment
    • Team 3 staging deployment
  • Team 3 workspace prod
    • Team 3 prod deployment

🎟 Issue(s)

#36

🧪 Functional Testing

📸 Screenshots

workspace_per_environment:
Screenshot 2024-05-17 at 9 52 27 PM

workspace_per_team:
Screenshot 2024-05-17 at 5 30 18 PM

workspace_per_team_per_environment:
Screenshot 2024-05-18 at 1 14 34 AM

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Added/updated applicable tests
  • Added/updated examples in the examples/ directory
  • Tested against Astro-API
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

@ichung08 ichung08 self-assigned this May 1, 2024
@ichung08 ichung08 requested review from vandyliu, sunkickr and a team as code owners May 1, 2024 23:42
@ichung08 ichung08 marked this pull request as draft May 1, 2024 23:42
@ichung08
Copy link
Collaborator Author

ichung08 commented May 2, 2024

Testing Observations:

  • Cannot create dedicated deployments using cluster_id = astro_cluster.prod_aws_cluster.id - seems like the deployment is waiting for the cluster id but doesn't get the id in time to create the deployment (since cluster takes a long time to create)
    • To create a dedicated deployment, you have to wait till cluster is created and then update the deployment's cluster_id to the new cluster's id - meaning you will have to run terraform apply multiple times
  • Running terraform apply in main.tf with an existing cluster name causes an error. Why doesn't terraform treat this like other resources (eg. workspaces or deployments) and just update them?
│ Error: Client error
│ 
│   with astro_cluster.prod_aws_cluster,
│   on main.tf line 254, in resource "astro_cluster" "prod_aws_cluster":
│  254: resource "astro_cluster" "prod_aws_cluster" {
│ 
│ cluster name prod-aws-cluster already exists, status: 400, requestId: 627578ee-b3ac-4bc5-98de-8c3a9269d3f2
  • Creating multiple clusters in main.tf only creates the first one, the other clusters fail
    Screenshot 2024-05-01 at 5 48 24 PM
    • Running terraform apply doesn't fix failed clusters - shouldn't it retry them if they fail?

@kushalmalani
Copy link

@ichung08 Can we add a note on each of those scenarios to describe what exactly it is?

@kushalmalani
Copy link

Also, do we want to add dev and staging scenarios in that doc?

@ichung08
Copy link
Collaborator Author

ichung08 commented May 8, 2024

Also, do we want to add dev and staging scenarios in that doc?

What do you mean by this? The scenarios cover a combination of dev, staging and prod in each scenario.

@kushalmalani
Copy link

Also, do we want to add dev and staging scenarios in that doc?

What do you mean by this? The scenarios cover a combination of dev, staging and prod in each scenario.

I meant, the dev and staging scenario has no value add for customers. Considering this repo is going to be public, do we need those scenarios?

@ichung08
Copy link
Collaborator Author

ichung08 commented May 8, 2024

Also, do we want to add dev and staging scenarios in that doc?

What do you mean by this? The scenarios cover a combination of dev, staging and prod in each scenario.

I meant, the dev and staging scenario has no value add for customers. Considering this repo is going to be public, do we need those scenarios?

Ah I see what you mean. I think as examples those scenarios can still be good to include (maybe change the names) as they show a different use case. Dev and Stage are setup to use standard deployments and Prod is setup for dedicated deployments.

@kushalmalani
Copy link

kushalmalani commented May 8, 2024

Also, do we want to add dev and staging scenarios in that doc?

What do you mean by this? The scenarios cover a combination of dev, staging and prod in each scenario.

I meant, the dev and staging scenario has no value add for customers. Considering this repo is going to be public, do we need those scenarios?

Ah I see what you mean. I think as examples those scenarios can still be good to include (maybe change the names) as they show a different use case. Dev and Stage are setup to use standard deployments and Prod is setup for dedicated deployments.

Yeah, that is what confused me...

@ichung08
Copy link
Collaborator Author

ichung08 commented May 8, 2024

Also, do we want to add dev and staging scenarios in that doc?

What do you mean by this? The scenarios cover a combination of dev, staging and prod in each scenario.

I meant, the dev and staging scenario has no value add for customers. Considering this repo is going to be public, do we need those scenarios?

Ah I see what you mean. I think as examples those scenarios can still be good to include (maybe change the names) as they show a different use case. Dev and Stage are setup to use standard deployments and Prod is setup for dedicated deployments.

Yeah, that is what confused me...

Yea this was part of the requirements listed here: #36

}

resource "astro_deployment" "team_1_dev_deployment" {
name = "team-1-dev-deployment"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will need to add astro_runtime_version to all the deployments as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

astro_runtime_version is a read only attribute so we can't add it

…vider into 36-add-examples-to-examples-folder-relating-to-the-3-standard-astro-scenarios
@ichung08 ichung08 marked this pull request as ready for review May 14, 2024 17:54
ichung08 and others added 3 commits May 14, 2024 11:25
@ichung08 ichung08 enabled auto-merge (squash) May 18, 2024 08:17
@ichung08 ichung08 merged commit bd8184b into main May 18, 2024
5 checks passed
@ichung08 ichung08 deleted the 36-add-examples-to-examples-folder-relating-to-the-3-standard-astro-scenarios branch May 18, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add examples to /examples folder relating to the 3 standard Astro scenarios
3 participants