{"id":22347771,"url":"https://github.com/wearetechnative/terraform-aws-module-static-website-cognito-auth","last_synced_at":"2025-10-14T20:30:36.671Z","repository":{"id":145718106,"uuid":"595239379","full_name":"wearetechnative/terraform-aws-module-static-website-cognito-auth","owner":"wearetechnative","description":"Creates resources for hosting a static website on S3 protected behind a Cognito login.","archived":false,"fork":false,"pushed_at":"2025-08-01T10:43:17.000Z","size":288,"stargazers_count":2,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-01T10:49:31.830Z","etag":null,"topics":["aws","cloudfront","cognito-user-pool","lambda","route53","s3-website","static-website"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/TechNative-B-V/static-website-cognito-auth/aws/latest","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wearetechnative.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2023-01-30T17:22:52.000Z","updated_at":"2025-08-01T10:43:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0004eab-3f34-44b1-96c8-af1efa8e8289","html_url":"https://github.com/wearetechnative/terraform-aws-module-static-website-cognito-auth","commit_stats":null,"previous_names":["wearetechnative/terraform-aws-module-static-website-cognito-auth"],"tags_count":8,"template":false,"template_full_name":"TechNative-B-V/terraform-aws-module-template","purl":"pkg:github/wearetechnative/terraform-aws-module-static-website-cognito-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-static-website-cognito-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-static-website-cognito-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-static-website-cognito-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-static-website-cognito-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wearetechnative","download_url":"https://codeload.github.com/wearetechnative/terraform-aws-module-static-website-cognito-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-static-website-cognito-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020905,"owners_count":26086948,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws","cloudfront","cognito-user-pool","lambda","route53","s3-website","static-website"],"created_at":"2024-12-04T10:10:51.810Z","updated_at":"2025-10-14T20:30:36.665Z","avatar_url":"https://github.com/wearetechnative.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform AWS Static Website Cognito Auth ![](https://img.shields.io/github/actions/workflow/status/TechNative-B-V/terraform-aws-static-website-cognito-auth/tflint.yaml)\n\n\u003c!-- SHIELDS --\u003e\n\nThis module implements a s3 bucket for hosting a static website behind a\ncognito login.\n\nWARNING THIS PROJECT IS WIP.\n\n[![](we-are-technative.png)](https://www.technative.nl)\n\n\n## Usage\n\nBelow an example how to use this module ...\n\n```hcl\nmodule \"docs_example_website\" {\n\n  source = \"TechNative-B-V/static-website-cognito-auth/aws\"\n\n  name                            = \"website_docs_example\"\n  domain                          = \"subdomain.example.com\"\n  route53_zone_name               = \"example.com.\"\n\n  deploy_user_name                = \"example_deployment_user\"\n\n  cognito_path_refresh_auth       = \"/refreshauth\"\n  cognito_path_logout             = \"/logout\"\n  cognito_path_parse_auth         = \"/parseauth\"\n  cognito_refresh_token_validity  = 3650\n  cognito_domain_prefix           = \"login\"\n\n  string_schemas = [\n    {\n      attribute_data_type = \"String\"\n      developer_only_attribute = false\n      mutable = true\n      name = \"office365tn\"\n      required = false\n      string_attribute_constraints = {\n        min_length = 1\n        max_length = 256\n      }\n    }\n  ]\n\n  providers = {\n    aws.us-east-1: aws.us-east-1\n  }\n}\n\noutput \"docs_example_website_deploy_key_id\" {\n  value = module.docs_example_website.iam_access_key_id\n}\n\noutput \"docs_example_website_deploy_key_secret\" {\n  value = module.docs_example_website.iam_access_key_secret\n  sensitive = true\n}\n```\n\n## Credits\n\nThis module was forked from [terraform-aws-website-secure](https://github.com/timmeinerzhagen/terraform-aws-website-secure) (MIT).\n\nAlso code from [terraform-aws-website](https://github.com/bwindsor/terraform-aws-website) was included (MIT).\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.0.2 |\n| \u003ca name=\"requirement_archive\"\u003e\u003c/a\u003e [archive](#requirement\\_archive) | \u003e= 2.2.0, \u003c 3.0.0 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | \u003e= 4.9.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e= 4.9.0 |\n| \u003ca name=\"provider_random\"\u003e\u003c/a\u003e [random](#provider\\_random) | n/a |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_acm\"\u003e\u003c/a\u003e [acm](#module\\_acm) | terraform-aws-modules/acm/aws | 5.0.0 |\n| \u003ca name=\"module_cloudfront\"\u003e\u003c/a\u003e [cloudfront](#module\\_cloudfront) | terraform-aws-modules/cloudfront/aws | 3.2.1 |\n| \u003ca name=\"module_cognito-user-pool\"\u003e\u003c/a\u003e [cognito-user-pool](#module\\_cognito-user-pool) | lgallard/cognito-user-pool/aws | 1.7.0 |\n| \u003ca name=\"module_lambda_function\"\u003e\u003c/a\u003e [lambda\\_function](#module\\_lambda\\_function) | ./modules/lambda | n/a |\n| \u003ca name=\"module_website_bucket\"\u003e\u003c/a\u003e [website\\_bucket](#module\\_website\\_bucket) | terraform-aws-modules/s3-bucket/aws | 5.2.0 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_iam_access_key.user_keys](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n| [aws_iam_user.user](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |\n| [aws_route53_record.cognito-domain](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |\n| [aws_route53_record.website-domain](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |\n| [aws_s3_bucket_policy.bucket_policy_web](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |\n| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource |\n| [aws_iam_policy_document.s3_policies](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_iam_policy_document.s3_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_bucket_policy_addition\"\u003e\u003c/a\u003e [bucket\\_policy\\_addition](#input\\_bucket\\_policy\\_addition) | Additional S3 policies in Terraform format. Can be derived using jsondecode(iam\\_policy\\_document.json). | `any` | `null` | no |\n| \u003ca name=\"input_cognito_additional_callbacks\"\u003e\u003c/a\u003e [cognito\\_additional\\_callbacks](#input\\_cognito\\_additional\\_callbacks) | Additional URLs to allow cognito callbacks to | `list(string)` | `[]` | no |\n| \u003ca name=\"input_cognito_additional_redirects\"\u003e\u003c/a\u003e [cognito\\_additional\\_redirects](#input\\_cognito\\_additional\\_redirects) | Additional URLs to allow cognito redirects to | `list(string)` | `[]` | no |\n| \u003ca name=\"input_cognito_client_supported_identity_providers\"\u003e\u003c/a\u003e [cognito\\_client\\_supported\\_identity\\_providers](#input\\_cognito\\_client\\_supported\\_identity\\_providers) | List of identity providers | `list(string)` | \u003cpre\u003e[\u003cbr/\u003e  \"COGNITO\"\u003cbr/\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_cognito_domain_prefix\"\u003e\u003c/a\u003e [cognito\\_domain\\_prefix](#input\\_cognito\\_domain\\_prefix) | The first part of the hosted UI login domain, as in https://[COGNITO_DOMAIN_PREFIX].[CUSTOM_DOMAIN]/ | `string` | `\"login\"` | no |\n| \u003ca name=\"input_cognito_path_logout\"\u003e\u003c/a\u003e [cognito\\_path\\_logout](#input\\_cognito\\_path\\_logout) | Path relative to custom\\_domain to redirect to after logging out | `string` | `\"/\"` | no |\n| \u003ca name=\"input_cognito_path_parse_auth\"\u003e\u003c/a\u003e [cognito\\_path\\_parse\\_auth](#input\\_cognito\\_path\\_parse\\_auth) | Path relative to custom\\_domain to redirect to upon successful authentication | `string` | `\"/parseauth\"` | no |\n| \u003ca name=\"input_cognito_path_refresh_auth\"\u003e\u003c/a\u003e [cognito\\_path\\_refresh\\_auth](#input\\_cognito\\_path\\_refresh\\_auth) | Path relative to `custom_domain` to redirect to when a token refresh is required | `string` | `\"/refreshauth\"` | no |\n| \u003ca name=\"input_cognito_refresh_token_validity\"\u003e\u003c/a\u003e [cognito\\_refresh\\_token\\_validity](#input\\_cognito\\_refresh\\_token\\_validity) | Time until the refresh token expires and the user will be required to log in again | `number` | `3650` | no |\n| \u003ca name=\"input_deploy_user_name\"\u003e\u003c/a\u003e [deploy\\_user\\_name](#input\\_deploy\\_user\\_name) | the username of the deploy user | `string` | n/a | yes |\n| \u003ca name=\"input_domain\"\u003e\u003c/a\u003e [domain](#input\\_domain) | The primary domain name to use for the website | `string` | n/a | yes |\n| \u003ca name=\"input_domain_aliases\"\u003e\u003c/a\u003e [domain\\_aliases](#input\\_domain\\_aliases) | A set of any alternative domain names. Typically this would just contain the same as custom\\_domain but prefixed by www. | `set(string)` | `[]` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | A unique string to use for this module to make sure resources do not clash with others | `string` | n/a | yes |\n| \u003ca name=\"input_region\"\u003e\u003c/a\u003e [region](#input\\_region) | AWS Region | `string` | n/a | yes |\n| \u003ca name=\"input_route53_zone_name\"\u003e\u003c/a\u003e [route53\\_zone\\_name](#input\\_route53\\_zone\\_name) | The name of the hosted zone in Route53 where the SSL certificates will be created | `string` | n/a | yes |\n| \u003ca name=\"input_string_schemas\"\u003e\u003c/a\u003e [string\\_schemas](#input\\_string\\_schemas) | String schemas to include | \u003cpre\u003elist(object({\u003cbr/\u003e    attribute_data_type = string\u003cbr/\u003e    developer_only_attribute = bool\u003cbr/\u003e    mutable = bool\u003cbr/\u003e    name = string\u003cbr/\u003e    required = bool\u003cbr/\u003e    string_attribute_constraints = object({\u003cbr/\u003e      min_length = number\u003cbr/\u003e      max_length = number\u003cbr/\u003e    })\u003cbr/\u003e  }))\u003c/pre\u003e | `[]` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_acm_certificate_domain_validation_options\"\u003e\u003c/a\u003e [acm\\_certificate\\_domain\\_validation\\_options](#output\\_acm\\_certificate\\_domain\\_validation\\_options) | n/a |\n| \u003ca name=\"output_alternate_urls\"\u003e\u003c/a\u003e [alternate\\_urls](#output\\_alternate\\_urls) | Alternate URLs of the website |\n| \u003ca name=\"output_cognito_user_pool_id\"\u003e\u003c/a\u003e [cognito\\_user\\_pool\\_id](#output\\_cognito\\_user\\_pool\\_id) | ID of the Cognito user pool. |\n| \u003ca name=\"output_iam_access_key_id\"\u003e\u003c/a\u003e [iam\\_access\\_key\\_id](#output\\_iam\\_access\\_key\\_id) | n/a |\n| \u003ca name=\"output_iam_access_key_secret\"\u003e\u003c/a\u003e [iam\\_access\\_key\\_secret](#output\\_iam\\_access\\_key\\_secret) | n/a |\n| \u003ca name=\"output_s3_bucket_arn\"\u003e\u003c/a\u003e [s3\\_bucket\\_arn](#output\\_s3\\_bucket\\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |\n| \u003ca name=\"output_s3_bucket_id\"\u003e\u003c/a\u003e [s3\\_bucket\\_id](#output\\_s3\\_bucket\\_id) | The name of the bucket |\n| \u003ca name=\"output_url\"\u003e\u003c/a\u003e [url](#output\\_url) | URL of the main website |\n| \u003ca name=\"output_user_arn\"\u003e\u003c/a\u003e [user\\_arn](#output\\_user\\_arn) | the arn of the user that was created |\n| \u003ca name=\"output_user_name\"\u003e\u003c/a\u003e [user\\_name](#output\\_user\\_name) | the name of the service account user that was created |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearetechnative%2Fterraform-aws-module-static-website-cognito-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwearetechnative%2Fterraform-aws-module-static-website-cognito-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearetechnative%2Fterraform-aws-module-static-website-cognito-auth/lists"}