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

ecs.ContainerOverride validation doesn't find it needs a Name - but it does #2553

Closed
jjmartin opened this issue Apr 8, 2019 · 3 comments
Closed
Labels
documentation This is a problem with documentation. service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@jjmartin
Copy link

jjmartin commented Apr 8, 2019

Please fill out the sections below to help us address your issue.
https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerOverride.html
mentions the name is needed but the go-sdk said my task was valid

Thanks to this: https://forums.aws.amazon.com/thread.jspa?threadID=227359

Version of AWS SDK for Go?

v1.19.11

Version of Go (go version)?

go version go1.12 windows/amd64

What issue did you see?

InvalidParameterException: name cannot be blank.

Steps to reproduce

If you have an runnable example, please include it.

creating RunTaskInput with TaskOverride but without a name

		runtask := &ecs.RunTaskInput{
			Count:          aws.Int64(1),
			TaskDefinition: aws.String(fmt.Sprintf("arn:aws:ecs:us-east-2:123456789120:task-definition/%s", taskTarget)),
			Cluster:        aws.String("my-cluster"),
			StartedBy:      aws.String("my-lambda"),
			LaunchType:     aws.String("FARGATE"),
			NetworkConfiguration: &ecs.NetworkConfiguration{
				AwsvpcConfiguration: &ecs.AwsVpcConfiguration{
					Subnets: []*string{
						aws.String("subnet-xxxxxxxx"),
						aws.String("subnet-yyyyyyyy"),
						aws.String("subnet-zzzzzzzzz"),
					},
					AssignPublicIp: aws.String("DISABLED"),
				},
			},
			Overrides: &ecs.TaskOverride{
				ContainerOverrides: []*ecs.ContainerOverride{
					&ecs.ContainerOverride{
// not including this is the error:	Name: &taskTarget,
						Command: []*string{
							aws.String(fmt.Sprintf("my-runnable -bucket %s -key %s", bucket, key)),
						},
					},
				},
			},
		}
		err = runtask.Validate()
		if err != nil {
			panic(err)
		}
		result, err := ecsSvc.RunTask(runtask) // returns the error InvalidParameterException: name cannot be blank.
@jasdel
Copy link
Contributor

jasdel commented Apr 9, 2019

Thanks for reaching out and reporting this issue to us @jjmartin. The best way to get this issue corrected is to submit feedback to the Amazon ECS team via the API Reference Docs for this operation, and clicking the Feedback button in the bottom right hand corner of the page. I'll do this as well internally. The AWS SDKs use the models provided to us by the Amazon ECS team for this client.

@jasdel jasdel added documentation This is a problem with documentation. service-api This issue is due to a problem in a service API, not the SDK implementation. labels Apr 9, 2019
@joelbrandenburg
Copy link

The 'name' parameter for a containerOverride is only required IF a containerOverride is specified. What this means is that it is possible to pass in an empty containerOverride, such as "{"containerOverrides": [ ]}" where the name is not included.

@diehlaws
Copy link
Contributor

Thank you for your patience in this matter @joelbrandenburg. The documentation for the ContainerOverride data type has been updated in both the API Reference Docs and the AWS SDK for Go Docs to reflect the need to specify a Name if a ContainerOverride is included in an API call's parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

4 participants