-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
New Resource: aws_cognito_user_pool_domain #2325
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good!
Just left a small nitpicks: it's up to you to go on or fix them, nothing critical!
make testacc TEST=./aws TESTARGS='-run=TestAccAWSCognitoUserPoolDomain_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCognitoUserPoolDomain_ -timeout 120m
=== RUN TestAccAWSCognitoUserPoolDomain_basic
--- PASS: TestAccAWSCognitoUserPoolDomain_basic (17.85s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 17.894s
Create: resourceAwsCognitoUserPoolDomainCreate, | ||
Read: resourceAwsCognitoUserPoolDomainRead, | ||
Delete: resourceAwsCognitoUserPoolDomainDelete, | ||
Importer: &schema.ResourceImporter{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of adding a test for the import?
|
||
func resourceAwsCognitoUserPoolDomainCreate(d *schema.ResourceData, meta interface{}) error { | ||
conn := meta.(*AWSClient).cognitoidpconn | ||
log.Print("[DEBUG] Creating Cognito User Pool Domain") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: I would add the params as %#v
here moving this after the structure definition
|
||
stateConf := resource.StateChangeConf{ | ||
Pending: []string{ | ||
cognitoidentityprovider.DomainStatusTypeCreating, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
d.Set("cloudfront_distribution_arn", desc.CloudFrontDistribution) | ||
d.Set("s3_bucket", desc.S3Bucket) | ||
d.Set("user_pool_id", desc.UserPoolId) | ||
d.Set("version", desc.Version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: What do you think of checking that these attributes are actually set, in the related test?
007dcb9
to
27d7a77
Compare
Addressed all comments, but I'll ship it after |
"domain": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of adding validation for the domain also, as in http://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateUserPoolDomain.html#API_CreateUserPoolDomain_RequestSyntax?
56069d6
to
50be8b1
Compare
50be8b1
to
8d6e751
Compare
This has been released in terraform-provider-aws version 1.7.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Test results