Skip to content

Commit

Permalink
updates to PR for new standards
Browse files Browse the repository at this point in the history
  • Loading branch information
alpacamybags118 committed Aug 31, 2021
1 parent bbeb5a5 commit 2d4117d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3,325 deletions.
3 changes: 3 additions & 0 deletions .changelog/10498.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-data-source
aws_iam_saml_provider
```
5 changes: 2 additions & 3 deletions aws/data_source_aws_iam_saml_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/iam"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func dataSourceAwsIAMSamlProvider() *schema.Resource {
Expand Down Expand Up @@ -54,7 +53,7 @@ func dataSourceAwsIAMSamlProviderRead(d *schema.ResourceData, meta interface{})
return fmt.Errorf("no SAML provider found")
}

d.SetId(*req.SAMLProviderArn)
d.SetId(aws.StringValue(req.SAMLProviderArn))

validUntil := resp.ValidUntil.Format(time.RFC1123)
dateCreated := resp.CreateDate.Format(time.RFC1123)
Expand Down
8 changes: 4 additions & 4 deletions aws/data_source_aws_iam_saml_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccAWSDataSourceSAMLProvider_basic(t *testing.T) {
Expand Down Expand Up @@ -33,11 +33,11 @@ func testAccIAMSamlProviderDataConfig(providerName string) string {
return fmt.Sprintf(`
resource "aws_iam_saml_provider" "test" {
name = %q
saml_metadata_document = "${file("./test-fixtures/saml-metadata.xml")}"
saml_metadata_document = file("./test-fixtures/saml-metadata.xml")
}
data "aws_iam_saml_provider" "test" {
arn = "${aws_iam_saml_provider.test.arn}"
arn = aws_iam_saml_provider.test.arn
}
`, providerName)
}
4 changes: 4 additions & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ func Provider() *schema.Provider {
"aws_iam_policy": dataSourceAwsIAMPolicy(),
"aws_iam_policy_document": dataSourceAwsIamPolicyDocument(),
"aws_iam_role": dataSourceAwsIAMRole(),
<<<<<<< HEAD
"aws_iam_roles": dataSourceAwsIAMRoles(),
=======
"aws_iam_saml_provider": dataSourceAwsIAMSamlProvider(),
>>>>>>> fe5e9eaa5 (updates to PR for new standards)
"aws_iam_server_certificate": dataSourceAwsIAMServerCertificate(),
"aws_iam_session_context": dataSourceAwsIAMSessionContext(),
"aws_iam_user": dataSourceAwsIAMUser(),
Expand Down
Loading

0 comments on commit 2d4117d

Please sign in to comment.