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

issue #4169 Allow dot in aws_vpn_connection tunnel preshared_key #4731

Merged
merged 2 commits into from
Jun 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aws/resource_aws_vpn_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ func validateVpnConnectionTunnelPreSharedKey(v interface{}, k string) (ws []stri
errors = append(errors, fmt.Errorf("%q cannot start with zero character", k))
}

if !regexp.MustCompile(`^[0-9a-zA-Z_]+$`).MatchString(value) {
errors = append(errors, fmt.Errorf("%q can only contain alphanumeric and underscore characters", k))
if !regexp.MustCompile(`^[0-9a-zA-Z_.]+$`).MatchString(value) {
errors = append(errors, fmt.Errorf("%q can only contain alphanumeric, period and underscore characters", k))
}

return
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_vpn_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestAccAWSVpnConnection_tunnelOptions(t *testing.T) {
},
{
Config: testAccAwsVpnConnectionConfigSingleTunnelOptions(rBgpAsn, "1234567!", "169.254.254.0/30"),
ExpectError: regexp.MustCompile(`can only contain alphanumeric and underscore characters`),
ExpectError: regexp.MustCompile(`can only contain alphanumeric, period and underscore characters`),
},

//Try actual building
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/vpn_connection.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The following arguments are supported:
* `tunnel2_inside_cidr` - (Optional) The CIDR block of the second IP addresses for the first VPN tunnel.
* `tunnel1_preshared_key` - (Optional) The preshared key of the first VPN tunnel.
* `tunnel2_preshared_key` - (Optional) The preshared key of the second VPN tunnel.
~> **Note:** The preshared key must be between 8 and 64 characters in length and cannot start with zero(0). Allowed characters are alphanumeric characters, periods(.) and underscores(_).

## Attribute Reference

Expand Down