Repository: chanzuckerberg/fogg
Pull request #669 (2022-06-28 19:13:39)

feat: add okta/okta provider
### Summary
This PR adds the real head okta/okta Terraform provider as one of the utility providers that fogg produces. This is helpful so that we can have an alias to the head set of changes from the Okta terraform provider and also use an internal fork of the Okta terraform provider to make improvements.

### Test Plan
Unit tests

### References
* https://github.com/hashicorp/terraform/issues/28823#issuecomment-857236321
* https://github.com/okta/terraform-provider-okta/blob/3883831416240b3d99108b533e4b7ad3a16cd68e/okta/resource_okta_app_oauth.go#L422-L425
* https://github.com/okta/terraform-provider-okta/blob/3883831416240b3d99108b533e4b7ad3a16cd68e/okta/app.go#L61


Patch:
diff --git a/plan/plan.go b/plan/plan.go
index cf1b8611..91ef223b 100644
--- a/plan/plan.go
+++ b/plan/plan.go
@@ -171,6 +171,10 @@ var utilityProviders = map[string]ProviderVersion{
 		Source:  "bwoznicki/assert",
 		Version: ptr.String("~> 0.0.1"),
 	},
+	"okta-head": {
+		Source:  "okta/okta",
+		Version: ptr.String("~> 3.30"),
+	},
 }
 
 //AWSProvider represents AWS provider configuration


Test patch:
diff --git a/testdata/auth0_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/auth0_provider_yaml/terraform/accounts/foo/fogg.tf
index d76a81e8..fa33b5e1 100644
--- a/testdata/auth0_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/auth0_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -55,6 +55,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/auth0_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/auth0_provider_yaml/terraform/envs/bar/bam/fogg.tf
index fa2c08f5..8ec3c72c 100644
--- a/testdata/auth0_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/auth0_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -55,6 +55,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/auth0_provider_yaml/terraform/global/fogg.tf b/testdata/auth0_provider_yaml/terraform/global/fogg.tf
index 2bd4da76..898ce594 100644
--- a/testdata/auth0_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/auth0_provider_yaml/terraform/global/fogg.tf
@@ -55,6 +55,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
index 17acf26a..6a6c29c6 100644
--- a/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -70,6 +70,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 046541e8..98a02cad 100644
--- a/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -70,6 +70,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/bless_provider_yaml/terraform/global/fogg.tf b/testdata/bless_provider_yaml/terraform/global/fogg.tf
index 1b9f4e7d..90905e8d 100644
--- a/testdata/bless_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/global/fogg.tf
@@ -70,6 +70,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/circleci/terraform/global/fogg.tf b/testdata/circleci/terraform/global/fogg.tf
index 4ec56084..556f9401 100644
--- a/testdata/circleci/terraform/global/fogg.tf
+++ b/testdata/circleci/terraform/global/fogg.tf
@@ -44,6 +44,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/github_actions/terraform/global/fogg.tf b/testdata/github_actions/terraform/global/fogg.tf
index 4ec56084..556f9401 100644
--- a/testdata/github_actions/terraform/global/fogg.tf
+++ b/testdata/github_actions/terraform/global/fogg.tf
@@ -44,6 +44,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/github_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/github_provider_yaml/terraform/accounts/foo/fogg.tf
index 3f07c80b..a9a9558c 100644
--- a/testdata/github_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/github_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -54,6 +54,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/github_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/github_provider_yaml/terraform/envs/bar/bam/fogg.tf
index cc60fc88..65e65cd5 100644
--- a/testdata/github_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/github_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -54,6 +54,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/github_provider_yaml/terraform/global/fogg.tf b/testdata/github_provider_yaml/terraform/global/fogg.tf
index db995350..246afdf3 100644
--- a/testdata/github_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/github_provider_yaml/terraform/global/fogg.tf
@@ -54,6 +54,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
index e82425ce..adbd744d 100644
--- a/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -56,6 +56,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 9d0c7d6f..36456d80 100644
--- a/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -56,6 +56,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/okta_provider_yaml/terraform/global/fogg.tf b/testdata/okta_provider_yaml/terraform/global/fogg.tf
index 9e4ba21c..55e0b23d 100644
--- a/testdata/okta_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/global/fogg.tf
@@ -56,6 +56,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/remote_backend_yaml/terraform/accounts/acct1/fogg.tf b/testdata/remote_backend_yaml/terraform/accounts/acct1/fogg.tf
index b594ba12..80b8055f 100644
--- a/testdata/remote_backend_yaml/terraform/accounts/acct1/fogg.tf
+++ b/testdata/remote_backend_yaml/terraform/accounts/acct1/fogg.tf
@@ -42,6 +42,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/remote_backend_yaml/terraform/global/fogg.tf b/testdata/remote_backend_yaml/terraform/global/fogg.tf
index 170b4530..8de1d64b 100644
--- a/testdata/remote_backend_yaml/terraform/global/fogg.tf
+++ b/testdata/remote_backend_yaml/terraform/global/fogg.tf
@@ -42,6 +42,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
index 4819f8b4..4ff26d6d 100644
--- a/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -50,6 +50,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 35b2f43a..75b6160c 100644
--- a/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -50,6 +50,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/snowflake_provider_yaml/terraform/global/fogg.tf b/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
index bc016a12..6249ab1d 100644
--- a/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
@@ -50,6 +50,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/tfe_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/tfe_provider_yaml/terraform/accounts/foo/fogg.tf
index 8a5cab12..902797cf 100644
--- a/testdata/tfe_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/tfe_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -47,6 +47,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/tfe_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/tfe_provider_yaml/terraform/envs/bar/bam/fogg.tf
index b331a311..44659d73 100644
--- a/testdata/tfe_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/tfe_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -44,6 +44,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/tfe_provider_yaml/terraform/global/fogg.tf b/testdata/tfe_provider_yaml/terraform/global/fogg.tf
index 6a92130a..a585042d 100644
--- a/testdata/tfe_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/tfe_provider_yaml/terraform/global/fogg.tf
@@ -47,6 +47,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf b/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
index d2fdf77e..c025922c 100644
--- a/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
@@ -206,6 +206,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/accounts/foo/fogg.tf b/testdata/v2_full_yaml/terraform/accounts/foo/fogg.tf
index 5a784dc2..e783f903 100644
--- a/testdata/v2_full_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/accounts/foo/fogg.tf
@@ -76,6 +76,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/datadog/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/datadog/fogg.tf
index ed98b886..4cd3a7f4 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/datadog/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/datadog/fogg.tf
@@ -67,6 +67,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/hero/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/hero/fogg.tf
index ca0cbe32..7793cd4c 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/hero/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/hero/fogg.tf
@@ -74,6 +74,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/okta/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/okta/fogg.tf
index b94b309b..0faeebd4 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/okta/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/okta/fogg.tf
@@ -70,6 +70,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/sentry/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/sentry/fogg.tf
index 98764910..b57e9968 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/sentry/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/sentry/fogg.tf
@@ -63,6 +63,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/vpc/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/vpc/fogg.tf
index f62d7260..503d77f9 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/vpc/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/vpc/fogg.tf
@@ -60,6 +60,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
index 1a64ab19..1402eb89 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
@@ -58,6 +58,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
index c0a84a44..28805182 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
@@ -58,6 +58,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
index e20eeca2..cd73e5de 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
@@ -58,6 +58,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_full_yaml/terraform/global/fogg.tf b/testdata/v2_full_yaml/terraform/global/fogg.tf
index 4d2f2491..b8b13cc6 100644
--- a/testdata/v2_full_yaml/terraform/global/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/global/fogg.tf
@@ -60,6 +60,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_minimal_valid_yaml/terraform/global/fogg.tf b/testdata/v2_minimal_valid_yaml/terraform/global/fogg.tf
index 4ec56084..556f9401 100644
--- a/testdata/v2_minimal_valid_yaml/terraform/global/fogg.tf
+++ b/testdata/v2_minimal_valid_yaml/terraform/global/fogg.tf
@@ -44,6 +44,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_no_aws_provider_yaml/terraform/envs/staging/vpc/fogg.tf b/testdata/v2_no_aws_provider_yaml/terraform/envs/staging/vpc/fogg.tf
index e1b8e716..470a96b1 100644
--- a/testdata/v2_no_aws_provider_yaml/terraform/envs/staging/vpc/fogg.tf
+++ b/testdata/v2_no_aws_provider_yaml/terraform/envs/staging/vpc/fogg.tf
@@ -44,6 +44,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"
 
diff --git a/testdata/v2_no_aws_provider_yaml/terraform/global/fogg.tf b/testdata/v2_no_aws_provider_yaml/terraform/global/fogg.tf
index 1e6be7b7..61a94512 100644
--- a/testdata/v2_no_aws_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/v2_no_aws_provider_yaml/terraform/global/fogg.tf
@@ -44,6 +44,13 @@ terraform {
 
     }
 
+    okta-head = {
+      source = "okta/okta"
+
+      version = "~> 3.30"
+
+    }
+
     random = {
       source = "hashicorp/random"