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

TaskDefinition.Options generated without field #297

Closed
ndeloof opened this issue Aug 17, 2020 · 8 comments
Closed

TaskDefinition.Options generated without field #297

ndeloof opened this issue Aug 17, 2020 · 8 comments

Comments

@ndeloof
Copy link
Contributor

ndeloof commented Aug 17, 2020

after code has been regenerated on #296

TaskDefinition_LogConfiguration.Options, which was previously a map[string]string, now is implemented as a *TaskDefinition_Options, but the latter has no field that can be used to pass options

@ndeloof
Copy link
Contributor Author

ndeloof commented Aug 17, 2020

I wonder this is an issue with the schema, as "AWS::ECS::TaskDefinition.Options" is declared with additionalProperties: false
Was previously:

"Options": {
                    "additionalProperties": true,
                    "patternProperties": {
                        "^[a-zA-Z0-9]+$": {
                            "type": "string"
                        }
                    },
                    "type": "object"
                }

@ndeloof
Copy link
Contributor Author

ndeloof commented Aug 17, 2020

Looking at cloudformation schema https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json I can't find the definition for the Options type.

@jonahjon
Copy link

jonahjon commented Aug 19, 2020

Looking at cloudformation schema https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json I can't find the definition for the Options type.

Where did you get this link from? When I dig into the link https://d1uauaxba7bl26.cloudfront.net/ it looks like the most recent version is from 2017, if the XML "" tag is correct. I do see the change made to the Docs though that supports this claim awsdocs/aws-cloudformation-user-guide@cb59b66.

I tested a fargate stack, and the "AWS::ECS::TaskDefinition.Options" still works when included in the cloudformation template so I'm unsure but will ask internally to try to figure more out.

@ndeloof
Copy link
Contributor Author

ndeloof commented Aug 19, 2020

@jonahjon
Copy link

This is the one used by generate : https://github.com/awslabs/goformation/blob/master/generate/main.go#L13

Ok, cool makes sense

@PaulMaddox
Copy link
Contributor

PaulMaddox commented Aug 25, 2020

The CloudFormation schema has the following, which looks correct to me at first glance.

It should be generating a map[string]string in goformation. Let me do some further investigation to work out what is going wrong here...

"AWS::ECS::TaskDefinition.LogConfiguration": {
    "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-logconfiguration.html",
    "Properties": {
    "LogDriver": {
        "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-logconfiguration.html#cfn-ecs-taskdefinition-containerdefinition-logconfiguration-logdriver",
        "UpdateType": "Immutable",
        "Required": true,
        "PrimitiveType": "String"
    },
    "Options": {
        "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-logconfiguration.html#cfn-ecs-taskdefinition-containerdefinition-logconfiguration-options",
        "UpdateType": "Immutable",
        "Required": false,
        "Type": "Map",
        "PrimitiveItemType": "String"
    },
    "SecretOptions": {
        "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-logconfiguration.html#cfn-ecs-taskdefinition-logconfiguration-secretoptions",
        "UpdateType": "Immutable",
        "Required": false,
        "Type": "List",
        "ItemType": "Secret"
    }
    }
},

@PaulMaddox
Copy link
Contributor

It looks like this was actually corrected last night in the upstream CloudFormation specification, and the goformation code is generating properly now.

Unfortunately there is another CloudFormation schema issue introduced that is causing our tests to fail and blocking a release. See issue #300. I have raised this internally.

screenshot

@PaulMaddox
Copy link
Contributor

Fixed in #320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants