Commit Graph

17 Commits

Author SHA1 Message Date
c51be05eb4
infra/main.tf: Correct typo in b9bee14 2023-05-04 23:00:14 -04:00
b9bee14f30
infra/main.tf: Adjust deployment script to account for unchange site file timestamps
* infra/main.tf: See 93dfdb0 for more detail regarding the deployment issue. In addition,
have the deployment script correctly fail if any command does not succeed.
2023-05-04 22:55:55 -04:00
b11aa217af
infra/main.tf: Correct typo in 93dfdb0 2023-05-02 22:01:23 -04:00
93dfdb08fd
infra/main.tf: Use --size-only option until 'aws s3 sync' can use checksums
* infra/main.tf: This avoid a deployment issue after switching to guix for builds. Namely,
after to switching to guix to build this project, all built site files will have a datetime
of Unix epoch 0, which will then never be updated when running 'aws s3 sync ...' because the
files in the bucket were deployed before the site was built using guix, so they have newer
timestamps. Using the '--size-only' option improves this situation, in that files that are
modified and have a different size then the original will be updated, but files that are
changed but, by chance have the same size, will not be updated. Ironically, the update that I
discovered this on will end up resulting the same file sizes (changing the copyright date).
2023-05-02 19:14:36 -04:00
54c48b55b8
infra: Remove unused template provider 2022-10-16 21:24:00 -04:00
f11fbdd3f4
infra/Makefile: Remove CI env var check for terraform workspace switching 2021-12-09 12:50:08 -05:00
1e1ae99446
Use guix for managing the required deployment environment
* infra/variables.tf: Add new variable 'site_statis_files_dir'

	* infra/manifest.scm: Add guix manifest that captures all tools required for deploying this site. This currently includes terraform, in use terraform providers, as well as awscliv2  which is used directly from a null resource

	* infra/main.tf: Pin all provider version so they are available from the rekahsoft-guix channel
	Remove the need for the template provider. It is still included as these changes need to be applied to all environments before it can be removed.
	Remove TF-UPGRAGE-TODO's
	Use the new variable 'site_static_files_dir' for the location of the static site files to be deployed

	* channels.scm (channel): Add symlink to top-level channels file

	* infra/Makefile (SELECTED_WORKSPACE): Removed the dependency on terraform
	(clean): Add new PHONY target 'clean' which cleans up terraform temporary files
	(workspace): Add new PHONY target 'workspace which switches to user provided ENV

	* channels.scm (channel): Updated rekahsoft-guix channel

	* README.org (Features): Updated sections on deployment
2021-12-06 22:25:05 -05:00
d9fc946d33
infra/main.tf: Always trigger deployment of static files upon apply 2019-12-15 21:21:06 -05:00
6fb3d3046b
Add AAAA records for native ipv6 reach-ability
Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2019-10-26 19:53:06 -04:00
9b779ec31b
Upgrade terraform from 0.11.x to 0.12
Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2019-06-13 22:57:31 -04:00
1ee07aab1f
Update terraform providers to the latest version
Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2019-06-13 22:53:47 -04:00
44094948cf
Update site script and hookup hakyll static file deploy
Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2018-12-15 21:58:18 -05:00
e83ccfb521
Use temporary config/credentials files when deploying app
This is primarily useful when testing locally, so that the users aws config/credentials aren't
polluted, and adds little no value otherwise.

Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2018-12-08 13:06:21 -05:00
ac8d11ca8f
Add versions for null, random, and template providers
Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2018-12-08 11:37:42 -05:00
f911d8bd74
Add staging workspace and corresponding environment
Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2018-12-08 11:37:39 -05:00
7116e5e16f
Redirect naked domain to www when enable_naked_domain=false
Adds the variables:

- `enable_naked_domain`

  Whether or not to enable access to the site only via a naked domain.

  When `enable_naked_domain=true`:

  - This corresponds to the previous configuration.

  When `enable_naked_domain=false`:

  - Sets the domain_name to the www version of the domain and adds the naked domain as a
    SAN (Subject Alternative Name) on the ACM certificate
  - Create dns validation records for both the naked domain and www domain
  - Creates a s3 bucket with redirect policy which redirects all requests to the www version
    of the site
  - Creates a cloudfront web distribution with a custom origin of the website bucket
    url (this is required as s3 origins do not handle redirects)

- `subdomain`

  The subdomain to use under the `dns_apex`, eg `<subdomain>.<dns_apex>`. Defaults to empty.
  Remember, `dns_apex` must correspond to a route53 public hosted zone.

Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2018-12-08 11:31:44 -05:00
186d04041d
Site infrastructure and deployment now managed with terraform
Create a classic static site deployment using cloudfront with a s3 origin. Provision, verify and
utilize a ACM certificate to enable (and force) https for cloudfront.

This assumes that the build resources are available at ./_site as a null_resource is used to
sync it to the s3 origin backing cloudfront. A IAM user and policy is provisioned prior to the
null_resource execution with least privilege access to the s3 bucket.

Note: The required terraform backend resources were manually provisioned.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2018-07-15 03:01:18 -04:00