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

Redshift master usernames may contain underscores #5935

Merged
merged 1 commit into from
Mar 31, 2016

Conversation

ethangunderson
Copy link

Ran into this when trying to bootstrap Terraform for my company. Our Redshift master username currently has an underscore in it.

@stack72
Copy link
Contributor

stack72 commented Mar 30, 2016

Hi @ethangunderson

Thanks for the PR. According to the AWS Documentation, the guidelines for master_username are as follows:

--master-username (string)

The user name associated with the master user account for the cluster that is being created.
Constraints:
Must be 1 - 128 alphanumeric characters.
First character must be a letter.
Cannot be a reserved word. A list of reserved words can be found in Reserved Words in the Amazon Redshift Database Developer Guide.

Is this definitely able to use _?

Paul

@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Mar 30, 2016
@ethangunderson
Copy link
Author

I thought it was weird too after after reading the AWS documentation. My guess is that their definition of alphanumerical, in this context, is inclusive of underscore, similar to \w.

I've verified this by creating a Redshift cluster with an _ in the username via the AWS CLI.

(☞ ゚∀ ゚)☞ ~ $ aws redshift create-cluster --cluster-identifier test-cluster --master-username test_user --node-type dc1.large --master-user-password *** --region=us-east-1 --cluster-type=single-node
{
    "Cluster": {
        "ClusterVersion": "1.0", 
        "NodeType": "dc1.large", 
        "PubliclyAccessible": true, 
        "Tags": [], 
        "MasterUsername": "test_user", 
        "ClusterParameterGroups": [
            {
                "ParameterGroupName": "default.redshift-1.0", 
                "ParameterApplyStatus": "in-sync"
            }
        ], 
        "Encrypted": false, 
        "ClusterSecurityGroups": [
            {
                "Status": "active", 
                "ClusterSecurityGroupName": "default"
            }
        ], 
        "AllowVersionUpgrade": true, 
        "VpcSecurityGroups": [], 
        "NumberOfNodes": 1, 
        "AutomatedSnapshotRetentionPeriod": 1, 
        "ClusterStatus": "creating", 
        "ClusterIdentifier": "test-cluster", 
        "DBName": "dev", 
        "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", 
        "PendingModifiedValues": {
            "MasterUserPassword": "****"
        }
    }
}

@stack72
Copy link
Contributor

stack72 commented Mar 31, 2016

Hi @ethangunderson

Thanks for showing the test here. The change looks good, I am going to run the TF acceptance tests across the change just to be sure

If they go green, I will merge it. If not I will let you know

P.

@stack72
Copy link
Contributor

stack72 commented Mar 31, 2016

Tests pass :)

TF_LOG=1 make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRedshiftCluster' 2>~/tf.log
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRedshiftCluster -timeout 120m
=== RUN   TestAccAWSRedshiftCluster_basic
--- PASS: TestAccAWSRedshiftCluster_basic (556.26s)
=== RUN   TestAccAWSRedshiftCluster_publiclyAccessible
--- PASS: TestAccAWSRedshiftCluster_publiclyAccessible (665.88s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    1222.156s

@stack72 stack72 merged commit 9d49c54 into hashicorp:master Mar 31, 2016
@ghost
Copy link

ghost commented Apr 27, 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 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants