Skip to content

JamesWoolfenden/terraform-aws-sslcert

Repository files navigation

terraform-aws-sslcert

Build Status Latest Release GitHub tag (latest SemVer) Terraform Version Infrastructure Tests pre-commit checkov Infrastructure Tests

Terraform module to provision an SSL certificate.

This follows the terraform example https://www.terraform.io/docs/providers/aws/r/acm_certificate_validation.html


It's 100% Open Source and licensed under the APACHE2.

Usage

This is a very basic example (so far).

ssl cert

Include this repository as a module in your existing Terraform code, as module.cert.tf:

module "cert" {
  source      = "JamesWoolfenden/sslcert/aws"
  version     = "v0.2.11"
  common_tags = var.common_tags
  domain      = "example.com"
  sub_domain  = "dev"
}

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_acm_certificate.certificate resource
aws_acm_certificate_validation.check resource
aws_route53_record.valid resource
aws_route53_zone.public data source

Inputs

Name Description Type Default Required
domain The domain name of the zone string n/a yes
sub_domain The sub-domain string n/a yes
ttl Time to Live number 60 no

Outputs

Name Description
arn The arn of the cert
domain_name The domain name
domain_validation_options domain_validation_options

Policy

This is the policy required to build this project:

The Terraform resource required is:

resource "aws_iam_policy" "terraform_pike" {
  name_prefix = "terraform_pike"
  path        = "/"
  description = "Pike Autogenerated policy from IAC"

  policy = jsonencode({
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "acm:DeleteCertificate",
                "acm:DescribeCertificate",
                "acm:ListTagsForCertificate",
                "acm:RequestCertificate"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "route53:ChangeResourceRecordSets",
                "route53:GetChange",
                "route53:GetHostedZone",
                "route53:ListHostedZones",
                "route53:ListResourceRecordSets",
                "route53:ListTagsForResource"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
})
}

Information

A terraform module to create an SSL cert for a DNS name.

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Copyrights

Copyright © 2019-2022 James Woolfenden

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributors

James Woolfenden
James Woolfenden