{"id":16314460,"url":"https://github.com/ntno/tf-module-static-site-cicd","last_synced_at":"2025-04-27T09:47:55.655Z","repository":{"id":133095815,"uuid":"582170381","full_name":"ntno/tf-module-static-site-cicd","owner":"ntno","description":"AWS infrastructure for static website CICD pipeline in GitHub Actions","archived":false,"fork":false,"pushed_at":"2025-03-16T22:38:16.000Z","size":27,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T23:28:37.810Z","etag":null,"topics":["github-actions","github-oidc"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ntno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-26T00:44:57.000Z","updated_at":"2025-03-16T22:37:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"85cb94ad-1bab-45f0-9634-3d230c98637d","html_url":"https://github.com/ntno/tf-module-static-site-cicd","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntno%2Ftf-module-static-site-cicd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntno%2Ftf-module-static-site-cicd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntno%2Ftf-module-static-site-cicd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntno%2Ftf-module-static-site-cicd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntno","download_url":"https://codeload.github.com/ntno/tf-module-static-site-cicd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250955349,"owners_count":21513495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","github-oidc"],"created_at":"2024-10-10T21:54:00.751Z","updated_at":"2025-04-26T07:53:39.743Z","avatar_url":"https://github.com/ntno.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tf-module-static-site-cicd\ncreates AWS infrastructure for reviewing static website.  compatible with [ntno/tf-module-static-site](https://github.com/ntno/tf-module-static-site).\n\nArtifact Bucket:\n  - used to store rendered site content\n\nCI Role:\n  - read/write to objects in artifact bucket\n  - create cloudformation stacks (restricted by stack name)\n  - create/destroy S3 buckets for static website testing (restricted by bucket name)\n    - read/write to temporary S3 buckets\n  - read/write on specified SSM parameters (optional)\n  - role assumption restricted to a specific github environment `github_environment_name` (optional)\n  \nCD Role(s):\n  - read/write to objects in artifact bucket\n  - read/write to objects in site bucket\n  - invalidate on cloudfront distribution for site (optional)\n  - read/write on specified SSM parameters (optional)\n  - role assumption restricted to a specific github environment `github_environment_name` (optional)\n    - this allows you to restrict who can deploy to the CD environment via repository/workflow settings\n\n## prerequisites\n- set up GitHub OpenID Connect provider\n  - [Use OpenID Connect within your workflows to authenticate with Amazon Web Services.](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services) \n  - [AWS Credentials GitHub action](https://github.com/aws-actions/configure-aws-credentials)\n- create GitHub environments if using optional `github_environment_name` input\n  - GitHub environments are not required, if `github_environment_name` is left blank role may be assumed by workflows for any branch in the repository\n\n## example usage\n\n### with GitHub Environment\nAssume the following steps have already been completed:\n- set up GitHub OpenID Connect provider (see prerequisites)\n- create S3 static website bucket `ntno.net`\n  - See [`ntno/tf-ntno.net`](https://github.com/ntno/tf-ntno.net) for complete example\n- `gh-ci` and `gh-prod` GitHub Environment created in `ntno/ntno.net` repository (required for this example)\n\n```\nmodule \"portfolio_site_cicd\" {\n  source = \"git::https://github.com/ntno/tf-module-static-site-cicd?ref=x.x.x\"\n\n  artifact_bucket_name = \"ntno.net-artifacts\"\n  github_org           = \"ntno\"\n  github_repo          = \"ntno.net\"\n  tags                 = local.global_tags\n\n  integration_environment = {\n    environment_id          = \"integration\"\n    github_environment_name = \"gh-ci\"\n    ci_prefix               = \"ntno-net-ci-pr\"\n    tags = {\n      project-environment = \"integration\"\n    }\n  }\n\n  deployment_environments = {\n    \"production\" = {\n      deploy_bucket              = \"ntno.net\"\n      github_environment_name    = \"gh-prod\"\n      cloudfront_distribution_id = module.portfolio_site.content_cloudfront_distribution_info.id\n      ssm_read_paths             = [aws_ssm_parameter.portfolio_site_cloudfront_distribution_id.name]\n      tags = {\n        project-environment = \"production\"\n      }\n    }\n  }\n}\n```\n\n### without GitHub Environment\nAssume the following steps have already been completed:\n- set up GitHub OpenID Connect provider (see prerequisites)\n- create S3 static website buckets `factually-settled-boxer` and `factually-settled-boxer-development`\n  - See [`infra/`](https://github.com/ntno/mkdocs-demo/tree/main/infra) in `ntno/mkdocs-demo` for complete example\n\n```\n# update x.x.x to desired version\nmodule \"demo_site_cicd\" {\n  source = \"git::https://github.com/ntno/tf-module-static-site-cicd?ref=x.x.x\"\n\n  artifact_bucket_name = \"factually-settled-boxer-artifacts\"\n  github_org           = \"ntno\"\n  github_repo          = \"mkdocs-demo\"\n  tags                 = local.global_tags\n\n  integration_environment = {\n    environment_id = \"integration\"\n    ci_prefix      = format(\"%s-%s-ci-pr-\", \"ntno\", \"mkdocs-demo\")\n    tags = {\n      project-environment = \"integration\"\n    }\n  }\n\n  deployment_environments = {\n    \"production\" = {\n      deploy_bucket           = \"factually-settled-boxer\"\n      tags = {\n        project-environment = \"production\"\n      }\n    },\n    \"development\" = {\n      deploy_bucket = \"factually-settled-boxer-development\"\n      tags = {\n        project-environment = \"development\"\n      }\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntno%2Ftf-module-static-site-cicd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntno%2Ftf-module-static-site-cicd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntno%2Ftf-module-static-site-cicd/lists"}