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

add name attribute #33243

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions internal/service/efs/file_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ func ResourceFileSystem() *schema.Resource {
},
},
},
"name": {
Type: schema.TypeString,
Computed: true,
},
"number_of_mount_targets": {
Type: schema.TypeInt,
Computed: true,
Expand Down Expand Up @@ -242,6 +246,7 @@ func resourceFileSystemRead(ctx context.Context, d *schema.ResourceData, meta in
d.Set("dns_name", meta.(*conns.AWSClient).RegionalHostname(fmt.Sprintf("%s.efs", aws.StringValue(fs.FileSystemId))))
d.Set("encrypted", fs.Encrypted)
d.Set("kms_key_id", fs.KmsKeyId)
d.Set("name", fs.Name)
d.Set("number_of_mount_targets", fs.NumberOfMountTargets)
d.Set("owner_id", fs.OwnerId)
d.Set("performance_mode", fs.PerformanceMode)
Expand Down
5 changes: 5 additions & 0 deletions internal/service/efs/file_system_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ func DataSourceFileSystem() *schema.Resource {
},
},
},
"name": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -158,6 +162,7 @@ func dataSourceFileSystemRead(ctx context.Context, d *schema.ResourceData, meta
d.Set("kms_key_id", fs.KmsKeyId)
d.Set("provisioned_throughput_in_mibps", fs.ProvisionedThroughputInMibps)
d.Set("throughput_mode", fs.ThroughputMode)
d.Set("name", fs.Name)
if fs.SizeInBytes != nil {
d.Set("size_in_bytes", fs.SizeInBytes.Value)
}
Expand Down
2 changes: 2 additions & 0 deletions internal/service/efs/file_system_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func TestAccEFSFileSystemDataSource_id(t *testing.T) {
resource.TestCheckResourceAttrPair(dataSourceName, "kms_key_id", resourceName, "kms_key_id"),
resource.TestCheckResourceAttrPair(dataSourceName, "tags", resourceName, "tags"),
resource.TestCheckResourceAttrPair(dataSourceName, "dns_name", resourceName, "dns_name"),
resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"),
resource.TestCheckResourceAttrPair(dataSourceName, "provisioned_throughput_in_mibps", resourceName, "provisioned_throughput_in_mibps"),
resource.TestCheckResourceAttrPair(dataSourceName, "throughput_mode", resourceName, "throughput_mode"),
resource.TestCheckResourceAttrPair(dataSourceName, "lifecycle_policy", resourceName, "lifecycle_policy"),
Expand Down Expand Up @@ -67,6 +68,7 @@ func TestAccEFSFileSystemDataSource_tags(t *testing.T) {
resource.TestCheckResourceAttrPair(dataSourceName, "kms_key_id", resourceName, "kms_key_id"),
resource.TestCheckResourceAttrPair(dataSourceName, "tags", resourceName, "tags"),
resource.TestCheckResourceAttrPair(dataSourceName, "dns_name", resourceName, "dns_name"),
resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"),
resource.TestCheckResourceAttrPair(dataSourceName, "provisioned_throughput_in_mibps", resourceName, "provisioned_throughput_in_mibps"),
resource.TestCheckResourceAttrPair(dataSourceName, "throughput_mode", resourceName, "throughput_mode"),
resource.TestCheckResourceAttrPair(dataSourceName, "lifecycle_policy", resourceName, "lifecycle_policy"),
Expand Down
1 change: 1 addition & 0 deletions internal/service/efs/file_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func TestAccEFSFileSystem_basic(t *testing.T) {
acctest.MatchResourceAttrRegionalHostname(resourceName, "dns_name", "efs", regexache.MustCompile(`fs-[^.]+`)),
resource.TestCheckResourceAttr(resourceName, "encrypted", "false"),
resource.TestCheckResourceAttr(resourceName, "lifecycle_policy.#", "0"),
acctest.MatchResourceAttrAccountID(resourceName, "name"),
resource.TestCheckResourceAttr(resourceName, "number_of_mount_targets", "0"),
acctest.MatchResourceAttrAccountID(resourceName, "owner_id"),
resource.TestCheckResourceAttr(resourceName, "performance_mode", "generalPurpose"),
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/efs_file_system.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ This data source exports the following attributes in addition to the arguments a
* `encrypted` - Whether EFS is encrypted.
* `kms_key_id` - ARN for the KMS encryption key.
* `lifecycle_policy` - File system [lifecycle policy](https://docs.aws.amazon.com/efs/latest/ug/API_LifecyclePolicy.html) object.
* `name` - File system name.
* `performance_mode` - File system performance mode.
* `provisioned_throughput_in_mibps` - The throughput, measured in MiB/s, that you want to provision for the file system.
* `tags` -A map of tags to assign to the file system.
Expand Down