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 EFS transit encryption and authorization config options for ECS task definition #13136

Merged
merged 23 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a2e0a3e
Update ECS task def resource schema
jukie May 2, 2020
384fb86
Update EFS volume config to account for transit encryption
jukie May 2, 2020
ecd240d
Update acceptance tests to use transit encryption
jukie May 2, 2020
3fdfdfb
Update website docs for EFS volume config options
jukie May 2, 2020
8a69551
"Update acceptance tests to use transit encryption"
jukie May 3, 2020
9cc8178
Merge remote-tracking branch 'upstream/master' into 12809-efs-vol-conf
jukie May 20, 2020
69b738b
Add EFS Access Point config schema and tests
jukie May 20, 2020
4d1ac27
Use bool values intsead
jukie May 20, 2020
98edb56
Add docs for authorization config
jukie May 20, 2020
c8bdc0e
Apply linting and remove extraneous change
jukie May 20, 2020
eb2c35f
Better align schema keys with api names
jukie Jun 10, 2020
ad54a93
Merge remote-tracking branch 'upstream/master' into 12809-efs-vol-conf
jukie Jun 10, 2020
3a8a596
Add new schemas to volume hash
jukie Jun 10, 2020
ff3457a
Update tests and fix encryption port
jukie Jun 10, 2020
fd9d5a8
Remove default root directory path and fix auth config hash
jukie Jun 10, 2020
099a608
Update website/docs/r/ecs_task_definition.html.markdown
jukie Jun 10, 2020
db5d4d4
Update website/docs/r/ecs_task_definition.html.markdown
jukie Jun 10, 2020
aa20722
Update website/docs/r/ecs_task_definition.html.markdown
jukie Jun 10, 2020
a6b19f4
Apply suggestions from code review
jukie Jun 10, 2020
e676776
Ignore root_directory if authorization_config is used
jukie Jun 10, 2020
68a9800
Add validator functions for EFSAuthorizationConfigIAM and EFSTransitE…
jukie Jun 11, 2020
4c5c6e4
Fix typo in function name
jukie Jun 11, 2020
b18cda5
Rebase from master
jukie Jun 20, 2020
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
Prev Previous commit
Next Next commit
Ignore root_directory if authorization_config is used
  • Loading branch information
jukie committed Jun 10, 2020
commit e6767767a0b3a1603a6f71182ca22adcde673ae6
1 change: 1 addition & 0 deletions aws/resource_aws_ecs_task_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func resourceAwsEcsTaskDefinition() *schema.Resource {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Default: "/",
},
"transit_encryption": {
Type: schema.TypeString,
Expand Down
5 changes: 2 additions & 3 deletions aws/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func expandEcsVolumes(configured []interface{}) ([]*ecs.Volume, error) {
if v, ok := config["root_directory"].(string); ok && v != "" {
jukie marked this conversation as resolved.
Show resolved Hide resolved
l.EfsVolumeConfiguration.RootDirectory = aws.String(v)
}

if v, ok := config["transit_encryption"].(string); ok && v != "" {
l.EfsVolumeConfiguration.TransitEncryption = aws.String(v)
}
Expand All @@ -171,6 +170,7 @@ func expandEcsVolumes(configured []interface{}) ([]*ecs.Volume, error) {
authConfig, ok := config["authorization_config"].([]interface{})
if ok && len(authConfig) > 0 {
authconfig := authConfig[0].(map[string]interface{})
l.EfsVolumeConfiguration.RootDirectory = nil
l.EfsVolumeConfiguration.AuthorizationConfig = &ecs.EFSAuthorizationConfig{}

if v, ok := authconfig["access_point_id"].(string); ok && v != "" {
Expand Down Expand Up @@ -766,10 +766,9 @@ func flattenEFSVolumeConfiguration(config *ecs.EFSVolumeConfiguration) []interfa
m["file_system_id"] = aws.StringValue(v)
}

if v := config.RootDirectory; v != nil && aws.StringValue(v) != "/" {
if v := config.RootDirectory; v != nil {
m["root_directory"] = aws.StringValue(v)
}

if v := config.TransitEncryption; v != nil {
m["transit_encryption"] = aws.StringValue(v)
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/ecs_task_definition.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ resource "aws_ecs_task_definition" "service" {
For more information, see [Specifying an EFS volume in your Task Definition Developer Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html#specify-efs-config)

* `file_system_id` - (Required) The ID of the EFS File System.
* `root_directory` - (Optional) The directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect as omitting this parameter.
* `root_directory` - (Optional) The directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect as omitting this parameter. This argument is ignored when using `authorization_config`.
* `transit_encryption` - (Optional) Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. Valid values: `ENABLED`, `DISABLED`. If this parameter is omitted, the default value of `DISABLED` is used.
* `transit_encryption_port` - (Optional) The port to use for transit encryption. If you do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses.
* `authorization_config` - (Optional) The authorization configuration details for the Amazon EFS file system.
Expand Down