From 5a2c1575144f4139b6c51813732d58f1332f8550 Mon Sep 17 00:00:00 2001 From: Pete Wilcock Date: Sat, 19 Jun 2021 20:16:04 +0100 Subject: [PATCH] 0.1.1 (#4) * Updating documentation and minor bugfixes --- .header.md | 45 ++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + README.md | 47 +++++++++++++++++++++++++++++++++- modules/codebuild/README.md | 2 +- modules/codebuild/variables.tf | 2 +- variables.tf | 2 +- 6 files changed, 95 insertions(+), 4 deletions(-) diff --git a/.header.md b/.header.md index 0bd5d5e..43b8b2c 100644 --- a/.header.md +++ b/.header.md @@ -159,3 +159,48 @@ resource "null_resource" "update_nameservers" { } ``` See [examples](docs/examples) for full set-up example. + +## Launching container, customize Wordpress and publish static site + +Check that the CodeBuild job for the container has built successfully. + +Toggle the `launch` value of the module to 1, and re-run Terraform plan/apply, which will launch the instance of the +Wordpress management container. + +First-time launch of container will take 5-6 minutes as the installation of Wordpress completes. You can +check status if you wish in CloudWatch log groups for ECS. It will come up within a few seconds on subsequent launches. + +The Wordpress management container will become available at http://wordpress.yourdomain.com (note HTTP, not HTTPS) by +default, unless you specified your own `wordpress_subdomain` prefix. + +Default admin is: supervisor +Default password: techtospeech.com + +Change these on first log in or specify your own in module instantiation. + +You will find WP2Static with S3 Add-on installed. Go to the WP2Static Menu->Addons, and click the 'Disabled' button to +Enable the Add-on. + +The configuration of the plugin has been set up such that no additional configuration is required unless you wish to +change any options. + +You may now edit Wordpress as you would normally, customize your site as you like, and when ready proceed to the 'Run' +section of the WP2Static plugin, and click the 'Generate Static Site' button. This will take some minutes depending on +the size of your site. When complete the site will be published in S3, and available via the public URL configured +in your module definition. + +Gentle reminder that no backup options are currently bundled with this module - the most effective means would be to +generate and retain a backup from within Wordpress for maximum flexibility. We recommend the UpdraftPlus plugin. + +## Troubleshooting + +If you experience issues with the publish element of WP2Static, you can retry. It can be more reliable to proceed to +'Caches' section and select to delete all caches. Currently you need to additionally delete the S3 deploy cache manually. + +You should also try increasing the CPU/Memory allocated to the container. Undersizing the container can cause timeout +issues that are currently not well handled in the plugin. + +If the job fails immediately and your site has previously generated a sitemaps.xml file, ensure you restore the plugin +that generates this file and the crawl job can fail fast if it cannot locate it. For all other features and issues +relating to WP2Static, [raise an issue on their repo](https://github.com/leonstafford/wp2static/issues). +For any issues relating to this module, [raise an issue against this repo.](https://github.com/TechToSpeech/terraform-aws-serverless-static-wordpress/issues) diff --git a/CHANGELOG.md b/CHANGELOG.md index df4eb97..f474bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.1.1 - 19th June 2021 Bugfix: Refactor md5 calculation on archive_file in codebuild child module. +Bugfix: Re-typed AWS account number as string to avoid rounding on account numbers prepended with zeros. ## 0.1.0 - 19th June 2021 diff --git a/README.md b/README.md index 4803ab3..8756087 100644 --- a/README.md +++ b/README.md @@ -161,11 +161,56 @@ resource "null_resource" "update_nameservers" { ``` See [examples](docs/examples) for full set-up example. +## Launching container, customize Wordpress and publish static site + +Check that the CodeBuild job for the container has built successfully. + +Toggle the `launch` value of the module to 1, and re-run Terraform plan/apply, which will launch the instance of the +Wordpress management container. + +First-time launch of container will take 5-6 minutes as the installation of Wordpress completes. You can +check status if you wish in CloudWatch log groups for ECS. It will come up within a few seconds on subsequent launches. + +The Wordpress management container will become available at http://wordpress.yourdomain.com (note HTTP, not HTTPS) by +default, unless you specified your own `wordpress_subdomain` prefix. + +Default admin is: supervisor +Default password: techtospeech.com + +Change these on first log in or specify your own in module instantiation. + +You will find WP2Static with S3 Add-on installed. Go to the WP2Static Menu->Addons, and click the 'Disabled' button to +Enable the Add-on. + +The configuration of the plugin has been set up such that no additional configuration is required unless you wish to +change any options. + +You may now edit Wordpress as you would normally, customize your site as you like, and when ready proceed to the 'Run' +section of the WP2Static plugin, and click the 'Generate Static Site' button. This will take some minutes depending on +the size of your site. When complete the site will be published in S3, and available via the public URL configured +in your module definition. + +Gentle reminder that no backup options are currently bundled with this module - the most effective means would be to +generate and retain a backup from within Wordpress for maximum flexibility. We recommend the UpdraftPlus plugin. + +## Troubleshooting + +If you experience issues with the publish element of WP2Static, you can retry. It can be more reliable to proceed to +'Caches' section and select to delete all caches. Currently you need to additionally delete the S3 deploy cache manually. + +You should also try increasing the CPU/Memory allocated to the container. Undersizing the container can cause timeout +issues that are currently not well handled in the plugin. + +If the job fails immediately and your site has previously generated a sitemaps.xml file, ensure you restore the plugin +that generates this file and the crawl job can fail fast if it cannot locate it. For all other features and issues +relating to WP2Static, [raise an issue on their repo](https://github.com/leonstafford/wp2static/issues). +For any issues relating to this module, [raise an issue against this repo.](https://github.com/TechToSpeech/terraform-aws-serverless-static-wordpress/issues) + ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID into which resources will be launched. | `number` | n/a | yes | +| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID into which resources will be launched. | `string` | n/a | yes | | [cloudfront\_aliases](#input\_cloudfront\_aliases) | The domain and sub-domain aliases to use for the cloudfront distribution. | `list(any)` | `[]` | no | | [cloudfront\_class](#input\_cloudfront\_class) | The [price class](https://aws.amazon.com/cloudfront/pricing/) for the distribution. One of: PriceClass\_All, PriceClass\_200, PriceClass\_100 | `string` | `"PriceClass_All"` | no | | [ecs\_cpu](#input\_ecs\_cpu) | The CPU limit password to the Wordpress container definition. | `number` | `256` | no | diff --git a/modules/codebuild/README.md b/modules/codebuild/README.md index 2dfab0f..b0fe45b 100644 --- a/modules/codebuild/README.md +++ b/modules/codebuild/README.md @@ -7,7 +7,7 @@ This module sets up the build to take a vanilla Wordpress image and bake customi | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID into which resources will be launched. | `number` | n/a | yes | +| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID into which resources will be launched. | `string` | n/a | yes | | [codebuild\_bucket](#input\_codebuild\_bucket) | The name of the bucket used for codebuild of the image. | `string` | n/a | yes | | [container\_memory](#input\_container\_memory) | The memory allocated to the container (in MB) | `number` | n/a | yes | | [main\_vpc\_id](#input\_main\_vpc\_id) | The VPC ID into which to launch resources. | `string` | n/a | yes | diff --git a/modules/codebuild/variables.tf b/modules/codebuild/variables.tf index f05c228..304200b 100644 --- a/modules/codebuild/variables.tf +++ b/modules/codebuild/variables.tf @@ -18,7 +18,7 @@ variable "wordpress_ecr_repository" { } variable "aws_account_id" { - type = number + type = string description = "The AWS account ID into which resources will be launched." } diff --git a/variables.tf b/variables.tf index 3dc71d7..34a5a15 100644 --- a/variables.tf +++ b/variables.tf @@ -13,7 +13,7 @@ variable "subnet_ids" { } variable "aws_account_id" { - type = number + type = string description = "The AWS account ID into which resources will be launched." }