Skip to content

Commit db1479f

Browse files
committed
Reverting S3 Definition
1 parent 01fb4f7 commit db1479f

File tree

2 files changed

+22
-43
lines changed

2 files changed

+22
-43
lines changed

ecs-files-input.json

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -174,37 +174,28 @@
174174
}
175175
},
176176
"S3Def": {
177-
"oneOf": [
178-
{
179-
"type": "object",
180-
"required": [
181-
"BucketName",
182-
"Key"
183-
],
184-
"properties": {
185-
"BucketName": {
186-
"type": "string",
187-
"description": "Name of the S3 Bucket"
188-
},
189-
"BucketRegion": {
190-
"type": "string",
191-
"description": "S3 Region to use. Default will ignore or retrieve via s3:GetBucketLocation"
192-
},
193-
"Key": {
194-
"type": "string",
195-
"description": "Full path to the file to retrieve"
196-
},
197-
"IamOverride": {
198-
"$ref": "#/definitions/IamOverrideDef"
199-
}
200-
}
177+
"type": "object",
178+
"required": [
179+
"BucketName",
180+
"Key"
181+
],
182+
"properties": {
183+
"BucketName": {
184+
"type": "string",
185+
"description": "Name of the S3 Bucket"
186+
},
187+
"BucketRegion": {
188+
"type": "string",
189+
"description": "S3 Region to use. Default will ignore or retrieve via s3:GetBucketLocation"
201190
},
202-
{
191+
"Key": {
203192
"type": "string",
204-
"pattern": "^arn:aws(?:-[a-z]+)?:s3:::(\\S+)::(\\S+)$",
205-
"description": "OneLiner with bucket ARN and path to key."
193+
"description": "Full path to the file to retrieve"
194+
},
195+
"IamOverride": {
196+
"$ref": "#/definitions/IamOverrideDef"
206197
}
207-
]
198+
}
208199
},
209200
"IamOverrideDef": {
210201
"type": "object",

ecs_files_composer/input.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# generated by datamodel-codegen:
22
# filename: ecs-files-input.json
3-
# timestamp: 2022-07-28T09:27:39+00:00
3+
# timestamp: 2022-07-28T10:48:50+00:00
44

55
from __future__ import annotations
66

77
from enum import Enum
8-
from typing import Dict, List, Optional, Union
8+
from typing import Dict, List, Optional
99

1010
from pydantic import AnyUrl, BaseModel, EmailStr, Extra, Field, constr
1111

@@ -26,14 +26,6 @@ class UrlDef(BaseModel):
2626
password: Optional[str] = Field(None, alias="Password")
2727

2828

29-
class S3DefItem1(BaseModel):
30-
__root__: str = Field(
31-
...,
32-
description="OneLiner with bucket ARN and path to key.",
33-
regex="^arn:aws(?:-[a-z]+)?:s3:::(\\S+)::(\\S+)$",
34-
)
35-
36-
3729
class IamOverrideDef(BaseModel):
3830
role_arn: Optional[str] = Field(None, alias="RoleArn")
3931
session_name: Optional[str] = Field(
@@ -144,7 +136,7 @@ class SecretDef(BaseModel):
144136
iam_override: Optional[IamOverrideDef] = Field(None, alias="IamOverride")
145137

146138

147-
class S3DefItem(BaseModel):
139+
class S3Def(BaseModel):
148140
bucket_name: str = Field(
149141
..., alias="BucketName", description="Name of the S3 Bucket"
150142
)
@@ -157,10 +149,6 @@ class S3DefItem(BaseModel):
157149
iam_override: Optional[IamOverrideDef] = Field(None, alias="IamOverride")
158150

159151

160-
class S3Def(BaseModel):
161-
__root__: Union[S3DefItem, S3DefItem1]
162-
163-
164152
class SourceDef(BaseModel):
165153
url: Optional[UrlDef] = Field(None, alias="Url")
166154
ssm: Optional[SsmDef] = Field(None, alias="Ssm")

0 commit comments

Comments
 (0)