Skip to content

Conversation

@amitchell-moz
Copy link
Contributor

@amitchell-moz amitchell-moz commented Dec 3, 2024

Add modules to provision AWS roles + OIDC configs to allow GKE workloads to assume AWS roles.

https://mozilla-hub.atlassian.net/browse/OPST-1509

This PR introduces 2 modules:

  • aws_gke_oidc_config
    • creates an OIDC provider in AWS to setup a trust relationship between a cluster & AWS account
  • aws_gke_oidc_role
    • creates AWS roles that use the trust relationship established by ^^ to allow GKE service accounts to assume AWS roles

These need to be separate modules because the OIDC provider URL must be unique per-account, but a given GKE cluster only has 1 OIDC endpoint. That means the OIDC provider tf must only be ran once, after that any number of roles can use it.

Changelog entry

Adds aws_gke_oidc_config and aws_gke_oidc_role modules

@amitchell-moz amitchell-moz changed the title add oidc_connector module feat:add oidc_connector module Dec 5, 2024
@amitchell-moz amitchell-moz changed the title feat:add oidc_connector module feat:add aws_gke_oidc_config and aws_gke_oidc_role modules Dec 5, 2024
jbuck
jbuck previously approved these changes Dec 15, 2024
Copy link
Member

@jbuck jbuck left a comment

Choose a reason for hiding this comment

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

Could you delete the .terraform.lock.hcl files? This looks good to me!


### Optional

variable "tags" {
Copy link
Member

Choose a reason for hiding this comment

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

I think you can remove this and add tags at the provider level with default_tags

@github-actions github-actions bot added the minor This PR will increment a minor version label Dec 18, 2024
tcotav and others added 5 commits December 18, 2024 12:56
…oup (#234)

* renaming google workgroups module to mozilla workgroup

Signed-off-by: Basma1912 <basad@mozilla.com>

* terraform fmt

Signed-off-by: Basma1912 <basad@mozilla.com>

* deleted mozilla workgroup

Signed-off-by: Basma1912 <basad@mozilla.com>

* Update mozilla_workgroup/README.md

Co-authored-by: Jason Thomas <jason@lithiumfox.com>

* Update mozilla_workgroup/README.md

Co-authored-by: Jason Thomas <jason@lithiumfox.com>

* change roles default value and add a comment

Signed-off-by: Basma1912 <basad@mozilla.com>

* chore(mozilla_workgroup): update the README file

Signed-off-by: Basma1912 <basad@mozilla.com>

---------

Signed-off-by: Basma1912 <basad@mozilla.com>
Co-authored-by: Jason Thomas <jason@lithiumfox.com>
* initial entitlement integration

* check prod/non-prod vars

* cleaning up pathing

* missed the beta for pam

* correct ent role list allowed

* correct ent role list allowed - rm local

* hardcode google-beta

* removed validation (for now)

* interpolate fail

* forgot local - fixed

* did + again on str, fixed

* wrong service name enabled

* wrong service name enabled - fixed

* iam brought into tf, now borked

* borked test, temp fix

* removed all enabling of API

* revert

* added disable_on_destroy false for services

* remove api on again

* going to nuke dependent services

* put service api in loop

* hardcoded

* one more try - iam fix

* force rm'd iam from tf

* added depends_on, separated prod, non

* missed the instance key

* more conditions to count

* rm'd service enable, add folder entitle

* enable svc

* forgot comment out fol ent

* fixed parent

* number of resource changes

* cp error - double resource

* HACK: add my user to all installs

* working hack - same as prev

* temp remove nonprod entitlement

* readd entitlement

* added more perms for sa pam

* added count on data project resources

* forgot count on reference to resource counted

* typo on c&p

* roles/ needed

* try again -- wrong proj

* enable other resources

* found roles - pam

* hc org number, fix typo in role

* adding back entitlement

* mod to hardcode dev

* cleanup after working

* removing me as owner - hack

* forgot to delete

* added org id var

* fixed err in desc of org id

* removed PAM svc add + related

* formatting tf

* removed extra depends_on

* tf fmt

* moved from google-beta to GA version

* adding req'd approval iam perms

* var.var typo

* tf fmt forgotten

* tidying up - foreach used

* integrate python func for slack

* remove alert trigger - false alarm

* tf fmt of new files

* duh - set and each

* fixed errors in tf

* toset

* TODO - remove my perms

* adding back tghe hack to add me to owner

* bad cp

* bucket name fix

* remove prod/nonprod from bucket name

* moved bucket to nonprod

* perms for builder

* perms for builder - each'd

* perms for builder - each'd

* perms for builder - each'd

* add run.invoker

* pubsub perms

* each.key. again

* trying to find the right way to add perms

* just going to leave off the perms for pubsub

* add guards ensuring at least one project for slack

* same as prev + tf fmt

* adding pam_entitlement

* tf plan works w/lookup... run next

* fixed additional entitlements

* slack fix+remove, merge mess entitlement fix

* clean up legacy tf for new ent yaml

* integrated publish to slack

* removed extra iam sa account

* chore: remove impersonate_service_account

* removed data src

* removed python code for slack

* removed owner_jfrancis perms grant

* fixed bool

* fix bool problem owner create

* CR fixes

* fixed dupe project id envs

* basic example add

* missed var name change in prev

* removed branch

* app_code default empty string

* caught empty app_code legacy

* chore(google_permissions): update README

---------

Co-authored-by: Jason Thomas <jason@lithiumfox.com>
* implement monorepo versioning proposal
* BREAKING CHANGE!: empty commit to make semantic PR happy
* fix: add missing pr template, remove releaserc now that semantic pr is gone
@amitchell-moz amitchell-moz changed the base branch from main to amitchell-OPST-1413-2 December 18, 2024 20:58
@amitchell-moz amitchell-moz changed the base branch from amitchell-OPST-1413-2 to main December 18, 2024 20:58
@amitchell-moz
Copy link
Contributor Author

Rebasing the new CI stuff in here blew up - opening a new clean PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor This PR will increment a minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants