Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: add iam_server_certificate data source #10558

Merged
merged 1 commit into from
Dec 7, 2016
Merged

provider/aws: add iam_server_certificate data source #10558

merged 1 commit into from
Dec 7, 2016

Conversation

nicolai86
Copy link
Contributor

this is useful e.g. when using lambda let's encrypt to generate IAM Server Certificates.

before this change you'd have to lookup the most recent certificate manually, e.g. using bash + variables. With this PR you can use a data source to do this automatically:

data "aws_iam_server_certificate" "my-domain" {
  name_prefix = "my-domain.org"
  latest = true
}

resource "aws_elb" "elb" {
  name = "my-domain-elb"

  listener {
    instance_port = 8000
    instance_protocol = "https"
    lb_port = 443
    lb_protocol = "https"
    ssl_certificate_id = "${data.aws_iam_server_certificate.my-domain.arn}"
  }
}

I've updated the documentation for this & also added unit- and integration tests for this:

make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDataSourceIAMServerCertificate_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/12/06 20:39:34 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDataSourceIAMServerCertificate_basic -timeout 120m
=== RUN   TestAccAWSDataSourceIAMServerCertificate_basic
--- PASS: TestAccAWSDataSourceIAMServerCertificate_basic (25.70s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	25.726s

useful if you have an automatic process creating certs for you, e.g. let's
lambda
@stack72
Copy link
Contributor

stack72 commented Dec 7, 2016

LGTM! Thanks @nicolai86

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDataSourceIAMServerCertificate_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/12/07 11:39:34 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDataSourceIAMServerCertificate_ -timeout 120m
=== RUN   TestAccAWSDataSourceIAMServerCertificate_basic
--- PASS: TestAccAWSDataSourceIAMServerCertificate_basic (21.31s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	21.328s

@stack72 stack72 merged commit 2b711f7 into hashicorp:master Dec 7, 2016
@nicolai86 nicolai86 deleted the aws-server-certificate-datasource branch December 7, 2016 11:20
@nicolai86
Copy link
Contributor Author

Thanks @stack72 ❤️

pielu pushed a commit to pielu/terraform that referenced this pull request Dec 20, 2016
* aws/feature/r-instance-net-iface-id: (74 commits)
  - Properly exercise network_interface_id from AWS SDK - Update Terraform’s documentation
  Update CHANGELOG.md
  provider/aws: Forces the api gateway domain name certificates to recreate the resource (hashicorp#10588)
  Update CHANGELOG.md
  provider/aws: FIxed the api_gw_domain_name replace operation (hashicorp#10179)
  Fixed note formatting
  Explicitly say `count` is not supported by modules (hashicorp#10553)
  docs/aws: Fix the discrepencies of the emr_cluster documentation (hashicorp#10578)
  Update CHANGELOG.md
  Service role is not updated on AWS for a CodeDeploy deployment group (hashicorp#9866)
  Update CHANGELOG.md
  provider/datadog hashicorp#9375: Refactor tags to a list instead of a map. (hashicorp#10570)
  Update the Vagrantfile to resolve package update/installation issue. (hashicorp#9783)
  docs/aws: Add iam_server_certificate data source to nav bar (hashicorp#10576)
  Update CHANGELOG.md
  feat/aws: add iam_server_certificate data source (hashicorp#10558)
  provider/azurerm: arm_virtual_machine panic fix
  Update .travis.yml
  provider/aws: Improved the documentation for EMR Cluster (hashicorp#10563)
  provider/azurerm: Do not pass an empty string of license_type to AMR VMs (hashicorp#10564)
  ...

# Conflicts:
#	builtin/providers/aws/resource_aws_instance.go
@ghost
Copy link

ghost commented Apr 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants