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

s3.wp-data-bucket - Definition is not conform to schema. #1

Open
aanno opened this issue Feb 26, 2024 · 2 comments · May be fixed by #2
Open

s3.wp-data-bucket - Definition is not conform to schema. #1

aanno opened this issue Feb 26, 2024 · 2 comments · May be fixed by #2

Comments

@aanno
Copy link

aanno commented Feb 26, 2024

If I try to deploy this on AWS, I get the following:

$ ecs-compose-x up -f docker-compose.yml -f aws.yml -n wordpress-demo
2024-02-26 20:12:29 [    INFO] Validating against input schema /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/specs/compose-spec.json
2024-02-26 20:12:29 [    INFO] volumes.persistent - Mapped to wordpress
2024-02-26 20:12:29 [    INFO] services.wordpress - No Launch Type defined. Using default: FARGATE
2024-02-26 20:12:30 [    INFO] Service families to process ['wordpress']
Loaded x-sns sns sns /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/sns
Loaded x-rds rds rds /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/rds
Loaded x-s3 s3 s3 /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/s3
Loaded x-acm acm acm /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/acm
Loaded x-elbv2 elbv2 elbv2 /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/elbv2
Loaded x-efs efs efs /stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/efs
/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/compose/x_resources/services_resources.py:216: DeprecationWarning: Services list will be deprecated in the next version. Use Services objects instead.
  warn(
2024-02-26 20:12:30 [   ERROR] s3.wp-data-bucket - Definition is not conform to schema.
Traceback (most recent call last):
  File "/stratis/home/tpasch/dev/venv/composex/bin/ecs-compose-x", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/cli.py", line 206, in main
    root_stack = generate_full_template(settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/ecs_composex.py", line 252, in generate_full_template
    settings.mod_manager.init_mods_resources(settings)
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/mods_manager.py", line 307, in init_mods_resources
    module.set_resources(settings)
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/mods_manager.py", line 266, in set_resources
    new_definition = self.resource_class(
                     ^^^^^^^^^^^^^^^^^^^^
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/s3/s3_bucket.py", line 40, in __init__
    super().__init__(name, definition, module, settings)
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/compose/x_resources/api_x_resources.py", line 31, in __init__
    super().__init__(name, definition, module, settings)
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/compose/x_resources/services_resources.py", line 40, in __init__
    super().__init__(name, definition, module, settings)
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/compose/x_resources/__init__.py", line 81, in __init__
    self.validate_schema(name, definition, module.mod_key)
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/ecs_composex/compose/x_resources/__init__.py", line 188, in validate_schema
    jsonschema.validate(
  File "/stratis/home/tpasch/dev/venv/composex/lib/python3.11/site-packages/jsonschema/validators.py", line 1121, in validate
    raise error
jsonschema.exceptions.ValidationError: [{'name': 'wordpress', 'access': {'Bucket': 'ListOnly', 'Objects': 'RW'}}] is not valid under any of the given schemas

Failed validating 'oneOf' in schema['properties']['Services']:
    {'oneOf': [{'items': {'properties': {'access': {'$ref': '#/definitions/ServicesAccess'},
                                         'name': {'type': 'string'}},
                          'required': ['name'],
                          'type': 'object'},
                'type': 'array'},
               {'patternProperties': {'[\\x20-\\x7E]+$': {'description': 'Object '
                                                                         'representation '
                                                                         'of '
                                                                         'the '
                                                                         'service '
                                                                         'to '
                                                                         'use.',
                                                          'properties': {'Access': {'$ref': '#/definitions/ServicesAccess'},
                                                                         'ReturnValues': {'additionalProperties': False,
                                                                                          'description': 'Set '
                                                                                                         'the '
                                                                                                         'CFN '
                                                                                                         'Return '
                                                                                                         'Value '
                                                                                                         'and '
                                                                                                         'the '
                                                                                                         'environment '
                                                                                                         'variable '
                                                                                                         'name '
                                                                                                         'you '
                                                                                                         'want '
                                                                                                         'to '
                                                                                                         'expose '
                                                                                                         'to '
                                                                                                         'the '
                                                                                                         'service',
                                                                                          'patternProperties': {'[\\x20-\\x7E]+$': {'oneOf': [{'$ref': 'x-resources.common.spec.json#/definitions/varNameDef'},
                                                                                                                                              {'additionalProperties': False,
                                                                                                                                               'properties': {'EnvVarName': {'$ref': 'x-resources.common.spec.json#/definitions/varNameDef'}},
                                                                                                                                               'type': 'object'}]}},
                                                                                          'type': 'object'}}}},
                'type': 'object'}]}

On instance['Services']:
    [{'access': {'Bucket': 'ListOnly', 'Objects': 'RW'},
      'name': 'wordpress'}]
$ ecs-compose-x version
ECS ComposeX 0.24.2
@JohnPreston
Copy link
Member

Hello @aanno
I will be pushing the updated fixes, added a few (optional) features like WAF

@JohnPreston JohnPreston linked a pull request Feb 28, 2024 that will close this issue
@JohnPreston
Copy link
Member

Hello @aanno
I have open #2 if you wanted to try from that branch and let me know how you get on?

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

Successfully merging a pull request may close this issue.

2 participants