mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 15:13:56 -06:00
43b74cfe79
* Adding import to resource_aws_iam_server_certificate. * provider/aws: Update tests for import of aws_iam_server_certificate Builds upon the work of @mrcopper in #12940 Resource: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSIAMServerCertificate_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/03/25 00:08:48 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSIAMServerCertificate_ -timeout 120m === RUN TestAccAWSIAMServerCertificate_importBasic --- PASS: TestAccAWSIAMServerCertificate_importBasic (22.81s) === RUN TestAccAWSIAMServerCertificate_basic --- PASS: TestAccAWSIAMServerCertificate_basic (19.68s) === RUN TestAccAWSIAMServerCertificate_name_prefix --- PASS: TestAccAWSIAMServerCertificate_name_prefix (19.88s) === RUN TestAccAWSIAMServerCertificate_disappears --- PASS: TestAccAWSIAMServerCertificate_disappears (13.94s) === RUN TestAccAWSIAMServerCertificate_file --- PASS: TestAccAWSIAMServerCertificate_file (32.67s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 109.062s ``` Data Source: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDataSourceIAMServerCertificate_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/03/25 13:07:10 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 (43.86s) === RUN TestAccAWSDataSourceIAMServerCertificate_matchNamePrefix --- PASS: TestAccAWSDataSourceIAMServerCertificate_matchNamePrefix (2.68s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 46.569s ```
359 lines
14 KiB
Go
359 lines
14 KiB
Go
package aws
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/aws/aws-sdk-go/aws"
|
|
"github.com/aws/aws-sdk-go/service/iam"
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
"github.com/hashicorp/terraform/terraform"
|
|
)
|
|
|
|
func TestAccAWSIAMServerCertificate_basic(t *testing.T) {
|
|
var cert iam.ServerCertificate
|
|
rInt := acctest.RandInt()
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckIAMServerCertificateDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: testAccIAMServerCertConfig(rInt),
|
|
Check: resource.ComposeTestCheckFunc(
|
|
testAccCheckCertExists("aws_iam_server_certificate.test_cert", &cert),
|
|
testAccCheckAWSServerCertAttributes(&cert),
|
|
),
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func TestAccAWSIAMServerCertificate_name_prefix(t *testing.T) {
|
|
var cert iam.ServerCertificate
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckIAMServerCertificateDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: testAccIAMServerCertConfig_random,
|
|
Check: resource.ComposeTestCheckFunc(
|
|
testAccCheckCertExists("aws_iam_server_certificate.test_cert", &cert),
|
|
testAccCheckAWSServerCertAttributes(&cert),
|
|
),
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func TestAccAWSIAMServerCertificate_disappears(t *testing.T) {
|
|
var cert iam.ServerCertificate
|
|
|
|
testDestroyCert := func(*terraform.State) error {
|
|
// reach out and DELETE the Cert
|
|
conn := testAccProvider.Meta().(*AWSClient).iamconn
|
|
_, err := conn.DeleteServerCertificate(&iam.DeleteServerCertificateInput{
|
|
ServerCertificateName: cert.ServerCertificateMetadata.ServerCertificateName,
|
|
})
|
|
|
|
if err != nil {
|
|
return fmt.Errorf("Error destroying cert in test: %s", err)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckIAMServerCertificateDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: testAccIAMServerCertConfig_random,
|
|
Check: resource.ComposeTestCheckFunc(
|
|
testAccCheckCertExists("aws_iam_server_certificate.test_cert", &cert),
|
|
testAccCheckAWSServerCertAttributes(&cert),
|
|
testDestroyCert,
|
|
),
|
|
ExpectNonEmptyPlan: true,
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func TestAccAWSIAMServerCertificate_file(t *testing.T) {
|
|
var cert iam.ServerCertificate
|
|
|
|
rInt := acctest.RandInt()
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckIAMServerCertificateDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: testAccIAMServerCertConfig_file(rInt, "iam-ssl-unix-line-endings"),
|
|
Check: resource.ComposeTestCheckFunc(
|
|
testAccCheckCertExists("aws_iam_server_certificate.test_cert", &cert),
|
|
testAccCheckAWSServerCertAttributes(&cert),
|
|
),
|
|
},
|
|
|
|
{
|
|
Config: testAccIAMServerCertConfig_file(rInt, "iam-ssl-windows-line-endings"),
|
|
Check: resource.ComposeTestCheckFunc(
|
|
testAccCheckCertExists("aws_iam_server_certificate.test_cert", &cert),
|
|
testAccCheckAWSServerCertAttributes(&cert),
|
|
),
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func testAccCheckCertExists(n string, cert *iam.ServerCertificate) resource.TestCheckFunc {
|
|
return func(s *terraform.State) error {
|
|
rs, ok := s.RootModule().Resources[n]
|
|
if !ok {
|
|
return fmt.Errorf("Not found: %s", n)
|
|
}
|
|
|
|
if rs.Primary.ID == "" {
|
|
return fmt.Errorf("No Server Cert ID is set")
|
|
}
|
|
|
|
conn := testAccProvider.Meta().(*AWSClient).iamconn
|
|
describeOpts := &iam.GetServerCertificateInput{
|
|
ServerCertificateName: aws.String(rs.Primary.Attributes["name"]),
|
|
}
|
|
resp, err := conn.GetServerCertificate(describeOpts)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*cert = *resp.ServerCertificate
|
|
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func testAccCheckAWSServerCertAttributes(cert *iam.ServerCertificate) resource.TestCheckFunc {
|
|
return func(s *terraform.State) error {
|
|
if !strings.Contains(*cert.ServerCertificateMetadata.ServerCertificateName, "terraform-test-cert") {
|
|
return fmt.Errorf("Bad Server Cert Name: %s", *cert.ServerCertificateMetadata.ServerCertificateName)
|
|
}
|
|
|
|
if *cert.CertificateBody != strings.TrimSpace(certBody) {
|
|
return fmt.Errorf("Bad Server Cert body\n\t expected: %s\n\tgot: %s\n", certBody, *cert.CertificateBody)
|
|
}
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func testAccCheckIAMServerCertificateDestroy(s *terraform.State) error {
|
|
conn := testAccProvider.Meta().(*AWSClient).iamconn
|
|
|
|
for _, rs := range s.RootModule().Resources {
|
|
if rs.Type != "aws_iam_server_certificate" {
|
|
continue
|
|
}
|
|
|
|
// Try to find the Cert
|
|
opts := &iam.GetServerCertificateInput{
|
|
ServerCertificateName: aws.String(rs.Primary.Attributes["name"]),
|
|
}
|
|
resp, err := conn.GetServerCertificate(opts)
|
|
if err == nil {
|
|
if resp.ServerCertificate != nil {
|
|
return fmt.Errorf("Error: Server Cert still exists")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
var certBody = fmt.Sprintf(`
|
|
-----BEGIN CERTIFICATE-----
|
|
MIIDBjCCAe4CCQCGWwBmOiHQdTANBgkqhkiG9w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9w==
|
|
-----END CERTIFICATE-----`)
|
|
|
|
func testAccIAMServerCertConfig(rInt int) string {
|
|
return fmt.Sprintf(`
|
|
resource "aws_iam_server_certificate" "test_cert" {
|
|
name = "terraform-test-cert-%d"
|
|
certificate_body = <<EOF
|
|
-----BEGIN CERTIFICATE-----
|
|
MIIDBjCCAe4CCQCGWwBmOiHQdTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB
|
|
VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0
|
|
cyBQdHkgTHRkMB4XDTE2MDYyMTE2MzM0MVoXDTE3MDYyMTE2MzM0MVowRTELMAkG
|
|
A1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0
|
|
IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
|
|
AL+LFlsCJG5txZp4yuu+lQnuUrgBXRG+irQqcTXlV91Bp5hpmRIyhnGCtWxxDBUL
|
|
xrh4WN3VV/0jDzKT976oLgOy3hj56Cdqf+JlZ1qgMN5bHB3mm3aVWnrnsLbBsfwZ
|
|
SEbk3Kht/cE1nK2toNVW+rznS3m+eoV3Zn/DUNwGlZr42hGNs6ETn2jURY78ETqR
|
|
mW47xvjf86eIo7vULHJaY6xyarPqkL8DZazOmvY06hUGvGwGBny7gugfXqDG+I8n
|
|
cPBsGJGSAmHmVV8o0RCB9UjY+TvSMQRpEDoVlvyrGuglsD8to/4+7UcsuDGlRYN6
|
|
jmIOC37mOi/jwRfWL1YUa4MCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAPDxTH0oQ
|
|
JjKXoJgkmQxurB81RfnK/NrswJVzWbOv6ejcbhwh+/ZgJTMc15BrYcxU6vUW1V/i
|
|
Z7APU0qJ0icECACML+a2fRI7YdLCTiPIOmY66HY8MZHAn3dGjU5TeiUflC0n0zkP
|
|
mxKJe43kcY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J3xGuNippH+ucTi/uq1+0tG1bd63v+75tn5l4LyY2
|
|
CWHRaWVlVn+WnDslkQTJzFD68X+9M7Cc4oP6WnhTyPamG7HlGv5JxfFHTC9GOKmz
|
|
sSc624BDmqYJ7Xzyhe5kc3iHzqG/L72ZF1aijZdrodQMSY1634UX6aECgYEA0Jdr
|
|
cBPSN+mgmEY6ogN5h7sO5uNV3TQQtW2IslfWZn6JhSRF4Rf7IReng48CMy9ZhFBy
|
|
Q7H2I1pDGjEC9gQHhgVfm+FyMSVqXfCHEW/97pvvu9ougHA0MhPep1twzTGrqg+K
|
|
f3PLW8hVkGyCrTfWgbDlPsHgsocA/wTaQOheaqMCgYBat5z+WemQfQZh8kXDm2xE
|
|
KD2Cota9BcsLkeQpdFNXWC6f167cqydRSZFx1fJchhJOKjkeFLX3hgzBY6VVLEPu
|
|
2jWj8imLNTv3Fhiu6RD5NVppWRkFRuAUbmo1SPNN2+Oa5YwGCXB0a0Alip/oQYex
|
|
zPogIB4mLlmrjNCtL4SB4QKBgCEHKMrZSJrz0irqS9RlanPUaZqjenAJE3A2xMNA
|
|
Z0FZXdsIEEyA6JGn1i1dkoKaR7lMp5sSbZ/RZfiatBZSMwLEjQv4mYUwoHP5Ztma
|
|
+wEyDbaX6G8L1Sfsv3+OWgETkVPfHBXsNtH0mZ/BnrtgsQVeBh52wmZiPAUlNo26
|
|
fWCzAoGBAJOjqovLelLWzyQGqPFx/MwuI56UFXd1CmFlCIvF2WxCFmk3tlExoCN1
|
|
HqSpt92vsgYgV7+lAb4U7Uy/v012gwiU1LK+vyAE9geo3pTjG73BNzG4H547xtbY
|
|
dg+Sd4Wjm89UQoUUoiIcstY7FPbqfBtYKfh4RYHAHV2BwDFqzZCM
|
|
-----END RSA PRIVATE KEY-----
|
|
EOF
|
|
}
|
|
`, rInt)
|
|
}
|
|
|
|
var testAccIAMServerCertConfig_random = `
|
|
resource "aws_iam_server_certificate" "test_cert" {
|
|
name_prefix = "terraform-test-cert"
|
|
certificate_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e5kc3iHzqG/L72ZF1aijZdrodQMSY1634UX6aECgYEA0Jdr
|
|
cBPSN+mgmEY6ogN5h7sO5uNV3TQQtW2IslfWZn6JhSRF4Rf7IReng48CMy9ZhFBy
|
|
Q7H2I1pDGjEC9gQHhgVfm+FyMSVqXfCHEW/97pvvu9ougHA0MhPep1twzTGrqg+K
|
|
f3PLW8hVkGyCrTfWgbDlPsHgsocA/wTaQOheaqMCgYBat5z+WemQfQZh8kXDm2xE
|
|
KD2Cota9BcsLkeQpdFNXWC6f167cqydRSZFx1fJchhJOKjkeFLX3hgzBY6VVLEPu
|
|
2jWj8imLNTv3Fhiu6RD5NVppWRkFRuAUbmo1SPNN2+Oa5YwGCXB0a0Alip/oQYex
|
|
zPogIB4mLlmrjNCtL4SB4QKBgCEHKMrZSJrz0irqS9RlanPUaZqjenAJE3A2xMNA
|
|
Z0FZXdsIEEyA6JGn1i1dkoKaR7lMp5sSbZ/RZfiatBZSMwLEjQv4mYUwoHP5Ztma
|
|
+wEyDbaX6G8L1Sfsv3+OWgETkVPfHBXsNtH0mZ/BnrtgsQVeBh52wmZiPAUlNo26
|
|
fWCzAoGBAJOjqovLelLWzyQGqPFx/MwuI56UFXd1CmFlCIvF2WxCFmk3tlExoCN1
|
|
HqSpt92vsgYgV7+lAb4U7Uy/v012gwiU1LK+vyAE9geo3pTjG73BNzG4H547xtbY
|
|
dg+Sd4Wjm89UQoUUoiIcstY7FPbqfBtYKfh4RYHAHV2BwDFqzZCM
|
|
-----END RSA PRIVATE KEY-----
|
|
EOF
|
|
}
|
|
`
|
|
|
|
// iam-ssl-unix-line-endings
|
|
func testAccIAMServerCertConfig_file(rInt int, fName string) string {
|
|
return fmt.Sprintf(`
|
|
resource "aws_iam_server_certificate" "test_cert" {
|
|
name = "terraform-test-cert-%d"
|
|
certificate_body = "${file("test-fixtures/%s.pem")}"
|
|
|
|
private_key = <<EOF
|
|
-----BEGIN RSA PRIVATE KEY-----
|
|
MIIEowIBAAKCAQEAv4sWWwI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