diff --git a/.header.md b/.header.md
index 74ee2da..43b8b2c 100644
--- a/.header.md
+++ b/.header.md
@@ -129,10 +129,7 @@ resource "null_resource" "trigger_build" {
codebuild_etag = module.peterdotcloud_website.codebuild_package_etag
}
provisioner "local-exec" {
- command = <<-EOT
- aws codebuild start-build --project-name "${module.peterdotcloud_website.codebuild_project_name}"
- --profile "${local.profile}" --region "${local.aws_region}"
- EOT
+ command = "aws codebuild start-build --project-name ${module.peterdotcloud_website.codebuild_project_name} --profile ${local.profile} --region ${local.aws_region}"
}
depends_on = [
module.peterdotcloud_website, module.docker_pullpush
@@ -156,13 +153,54 @@ resource "null_resource" "update_nameservers" {
nameservers = aws_route53_zone.apex.id
}
provisioner "local-exec" {
- command = <<-EOT
- aws route53domains update-domain-nameservers --region us-east-1 --domain-name "${local.site_domain}"
- --nameservers Name="${aws_route53_zone.apex.name_servers.0}" Name="${aws_route53_zone.apex.name_servers.1}"
- Name="${aws_route53_zone.apex.name_servers.2}" Name="${aws_route53_zone.apex.name_servers.3}" --profile peterdotcloud
- EOT
+ command = "aws route53domains update-domain-nameservers --region us-east-1 --domain-name ${local.site_domain} --nameservers Name=${aws_route53_zone.apex.name_servers.0}Name=${aws_route53_zone.apex.name_servers.1} Name=${aws_route53_zone.apex.name_servers.2} Name=${aws_route53_zone.apex.name_servers.3} --profile peterdotcloud"
}
depends_on = [aws_route53_zone.apex]
}
```
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 decc2fc..8756087 100644
--- a/README.md
+++ b/README.md
@@ -130,10 +130,7 @@ resource "null_resource" "trigger_build" {
codebuild_etag = module.peterdotcloud_website.codebuild_package_etag
}
provisioner "local-exec" {
- command = <<-EOT
- aws codebuild start-build --project-name "${module.peterdotcloud_website.codebuild_project_name}"
- --profile "${local.profile}" --region "${local.aws_region}"
- EOT
+ command = "aws codebuild start-build --project-name ${module.peterdotcloud_website.codebuild_project_name} --profile ${local.profile} --region ${local.aws_region}"
}
depends_on = [
module.peterdotcloud_website, module.docker_pullpush
@@ -157,22 +154,63 @@ resource "null_resource" "update_nameservers" {
nameservers = aws_route53_zone.apex.id
}
provisioner "local-exec" {
- command = <<-EOT
- aws route53domains update-domain-nameservers --region us-east-1 --domain-name "${local.site_domain}"
- --nameservers Name="${aws_route53_zone.apex.name_servers.0}" Name="${aws_route53_zone.apex.name_servers.1}"
- Name="${aws_route53_zone.apex.name_servers.2}" Name="${aws_route53_zone.apex.name_servers.3}" --profile peterdotcloud
- EOT
+ command = "aws route53domains update-domain-nameservers --region us-east-1 --domain-name ${local.site_domain} --nameservers Name=${aws_route53_zone.apex.name_servers.0}Name=${aws_route53_zone.apex.name_servers.1} Name=${aws_route53_zone.apex.name_servers.2} Name=${aws_route53_zone.apex.name_servers.3} --profile peterdotcloud"
}
depends_on = [aws_route53_zone.apex]
}
```
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/docs/examples/main.tf b/docs/examples/main.tf
index 61f9038..a0c5f9a 100644
--- a/docs/examples/main.tf
+++ b/docs/examples/main.tf
@@ -61,10 +61,7 @@ resource "null_resource" "trigger_build" {
codebuild_etag = module.peterdotcloud_website.codebuild_package_etag
}
provisioner "local-exec" {
- command = <<-EOT
- aws codebuild start-build --project-name "${module.peterdotcloud_website.codebuild_project_name}"
- --profile "${local.profile}" --region "${local.aws_region}"
- EOT
+ command = "aws codebuild start-build --project-name ${module.peterdotcloud_website.codebuild_project_name} --profile ${local.profile} --region ${local.aws_region}"
}
depends_on = [
module.peterdotcloud_website, module.docker_pullpush
@@ -83,11 +80,7 @@ resource "null_resource" "update_nameservers" {
nameservers = aws_route53_zone.apex.id
}
provisioner "local-exec" {
- command = <<-EOT
- aws route53domains update-domain-nameservers --region us-east-1 --domain-name "${local.site_domain}"
- --nameservers Name="${aws_route53_zone.apex.name_servers.0}" Name="${aws_route53_zone.apex.name_servers.1}"
- Name="${aws_route53_zone.apex.name_servers.2}" Name="${aws_route53_zone.apex.name_servers.3}" --profile peterdotcloud
- EOT
+ command = "aws route53domains update-domain-nameservers --region us-east-1 --domain-name ${local.site_domain} --nameservers Name=${aws_route53_zone.apex.name_servers.0}Name=${aws_route53_zone.apex.name_servers.1} Name=${aws_route53_zone.apex.name_servers.2} Name=${aws_route53_zone.apex.name_servers.3} --profile peterdotcloud"
}
depends_on = [aws_route53_zone.apex]
}
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."
}