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: Added Cognito Identity Pool #13783

Merged
merged 1 commit into from
Apr 21, 2017

Conversation

Ninir
Copy link
Contributor

@Ninir Ninir commented Apr 19, 2017

Description

This adds Cognito Identity Pool, and is the second step for integrating Cognito.

(This is just splitting #12846 in 3, for better reviews :))

Tests

$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCognitoIdentityPool'                 
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/20 11:35:46 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSCognitoIdentityPool -timeout 120m
=== RUN   TestAccAWSCognitoIdentityPool_importBasic
--- PASS: TestAccAWSCognitoIdentityPool_importBasic (16.94s)
=== RUN   TestAccAWSCognitoIdentityPool_basic
--- PASS: TestAccAWSCognitoIdentityPool_basic (23.00s)
=== RUN   TestAccAWSCognitoIdentityPool_supportedLoginProviders
--- PASS: TestAccAWSCognitoIdentityPool_supportedLoginProviders (34.65s)
=== RUN   TestAccAWSCognitoIdentityPool_openidConnectProviderArns
--- PASS: TestAccAWSCognitoIdentityPool_openidConnectProviderArns (32.00s)
=== RUN   TestAccAWSCognitoIdentityPool_samlProviderArns
--- PASS: TestAccAWSCognitoIdentityPool_samlProviderArns (37.89s)
=== RUN   TestAccAWSCognitoIdentityPool_cognitoIdentityProviders
--- PASS: TestAccAWSCognitoIdentityPool_cognitoIdentityProviders (32.96s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	177.482s

@Ninir
Copy link
Contributor Author

Ninir commented Apr 20, 2017

@radeksimko Step 2 on 3 :)

@Ninir Ninir force-pushed the f-aws-cognito-identitypool branch from 6aba53c to eec174d Compare April 20, 2017 09:46
Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ninir

Few comments inline - apart from those, it LGTM!

Paul

},

"cognito_identity_providers": {
Type: schema.TypeSet,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why a set over a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so we talked with @radeksimko about this (thanks for the input by the way 👍 ) and a TypeSet is totally fine.
The ordering of providers doesn't matter, since they are no fallbacks when authenticating as far as we know! :)

Optional: true,
ValidateFunc: validateCognitoIdentityProvidersProviderName,
},
"server_side_token_check": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should set a default here - otherwise you will never be able to change from true -> false based on the bug with d.GetOk and default values (i.e. default bool being false)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh didn't know there was this bug! fixing :)


"allow_unauthenticated_identities": {
Type: schema.TypeBool,
Required: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we should set a default on this as well otherwise that bug will reappear

IdentityPoolId: aws.String(d.Id()),
})
if err != nil {
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see this as part of it straight away :)

@Ninir Ninir force-pushed the f-aws-cognito-identitypool branch from eec174d to 5de6e66 Compare April 21, 2017 08:49
@Ninir
Copy link
Contributor Author

Ninir commented Apr 21, 2017

Hey @stack72

Thanks for the review! I've made the changes you asked, and also removed the hash function on the
cognito_identity_providers Set so that the default one is used.

Tests

make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCognitoIdentityPool'                         
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/21 10:44:48 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSCognitoIdentityPool -timeout 120m
=== RUN   TestAccAWSCognitoIdentityPool_importBasic
--- PASS: TestAccAWSCognitoIdentityPool_importBasic (16.48s)
=== RUN   TestAccAWSCognitoIdentityPool_basic
--- PASS: TestAccAWSCognitoIdentityPool_basic (24.38s)
=== RUN   TestAccAWSCognitoIdentityPool_supportedLoginProviders
--- PASS: TestAccAWSCognitoIdentityPool_supportedLoginProviders (37.55s)
=== RUN   TestAccAWSCognitoIdentityPool_openidConnectProviderArns
--- PASS: TestAccAWSCognitoIdentityPool_openidConnectProviderArns (36.12s)
=== RUN   TestAccAWSCognitoIdentityPool_samlProviderArns
--- PASS: TestAccAWSCognitoIdentityPool_samlProviderArns (58.25s)
=== RUN   TestAccAWSCognitoIdentityPool_cognitoIdentityProviders
--- PASS: TestAccAWSCognitoIdentityPool_cognitoIdentityProviders (33.44s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	206.253s

@stack72
Copy link
Contributor

stack72 commented Apr 21, 2017

Thanks for this work @Ninir :) LGTM! Was purely curious about the Set vs List so was more of a question rather than anything else

Nice to see the use of the default Hash as well!

@stack72 stack72 merged commit 80d940d into hashicorp:master Apr 21, 2017
@Ninir Ninir deleted the f-aws-cognito-identitypool branch November 1, 2017 08:55
@ghost
Copy link

ghost commented Apr 6, 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 6, 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.

3 participants