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 #7466 Add security_group_id attribute to aws_directory_service_directory for ADConnector #7487

Merged
merged 2 commits into from
Feb 12, 2019
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
6 changes: 4 additions & 2 deletions aws/resource_aws_directory_service_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,10 @@ func resourceAwsDirectoryServiceDirectoryRead(d *schema.ResourceData, meta inter
d.Set("connect_settings", flattenDSConnectSettings(dir.DnsIpAddrs, dir.ConnectSettings))
d.Set("enable_sso", dir.SsoEnabled)

if dir.VpcSettings != nil {
d.Set("security_group_id", *dir.VpcSettings.SecurityGroupId)
if aws.StringValue(dir.Type) == directoryservice.DirectoryTypeAdconnector {
d.Set("security_group_id", aws.StringValue(dir.ConnectSettings.SecurityGroupId))
} else {
d.Set("security_group_id", aws.StringValue(dir.VpcSettings.SecurityGroupId))
}

tagList, err := dsconn.ListTagsForResource(&directoryservice.ListTagsForResourceInput{
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_directory_service_directory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ func TestAccAWSDirectoryServiceDirectory_connector(t *testing.T) {
Config: testAccDirectoryServiceDirectoryConfig_connector,
Check: resource.ComposeTestCheckFunc(
testAccCheckServiceDirectoryExists("aws_directory_service_directory.connector"),
resource.TestCheckResourceAttrSet("aws_directory_service_directory.connector", "security_group_id"),
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/directory_service_directory.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ In addition to all arguments above, the following attributes are exported:
* `id` - The directory identifier.
* `access_url` - The access URL for the directory, such as `http://alias.awsapps.com`.
* `dns_ip_addresses` - A list of IP addresses of the DNS servers for the directory or connector.
* `security_group_id` - The ID of the security group created by the directory (`SimpleAD` or `MicrosoftAD` only).
* `security_group_id` - The ID of the security group created by the directory.


## Import
Expand Down