Skip to content

Commit

Permalink
[aws][fix] Custom headers as dict (#1998)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias authored Mar 20, 2024
1 parent ed8fdb5 commit 11d9fd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion fixcore/fixcore/model/graph_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Direction:
EdgeKey = namedtuple("EdgeKey", ["from_node", "to_node", "edge_type"])

# Global list of properties to ignore when computing the history hash of a node.
PropsToIgnoreForHistory = {"ctime", "atime", "mtime", "last_update", "resource_version"}
PropsToIgnoreForHistory = {"ctime", "atime", "mtime", "age", "last_access", "last_update", "resource_version"}


@define
Expand Down
17 changes: 2 additions & 15 deletions plugins/aws/fix_plugin_aws/resource/cloudfront.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,6 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]:
]


@define(eq=False, slots=False)
class AwsCloudFrontOriginCustomHeader:
kind: ClassVar[str] = "aws_cloudfront_origin_custom_header"
kind_display: ClassVar[str] = "AWS CloudFront Origin Custom Header"
kind_description: ClassVar[str] = (
"AWS CloudFront Origin Custom Header is a feature of Amazon CloudFront that"
" allows users to add custom headers to requests sent to the origin server."
)
mapping: ClassVar[Dict[str, Bender]] = {"header_name": S("HeaderName"), "header_value": S("HeaderValue")}
header_name: Optional[str] = field(default=None)
header_value: Optional[str] = field(default=None)


@define(eq=False, slots=False)
class AwsCloudFrontCustomOriginConfig:
kind: ClassVar[str] = "aws_cloudfront_custom_origin_config"
Expand Down Expand Up @@ -152,7 +139,7 @@ class AwsCloudFrontOrigin:
"id": S("Id"),
"domain_name": S("DomainName"),
"origin_path": S("OriginPath"),
"custom_header": S("CustomHeaders", "Items", default=[]) >> ForallBend(AwsCloudFrontOriginCustomHeader.mapping),
"custom_header": S("CustomHeaders", "Items", default=[]) >> ToDict("HeaderName", "HeaderValue"),
"s3_origin_config": S("S3OriginConfig", "OriginAccessIdentity"),
"custom_origin_config": S("CustomOriginConfig") >> Bend(AwsCloudFrontCustomOriginConfig.mapping),
"connection_attempts": S("ConnectionAttempts"),
Expand All @@ -163,7 +150,7 @@ class AwsCloudFrontOrigin:
id: Optional[str] = field(default=None)
domain_name: Optional[str] = field(default=None)
origin_path: Optional[str] = field(default=None)
custom_header: List[AwsCloudFrontOriginCustomHeader] = field(factory=list)
custom_header: Dict[str, str] = field(factory=list)
s3_origin_config: Optional[str] = field(default=None)
custom_origin_config: Optional[AwsCloudFrontCustomOriginConfig] = field(default=None)
connection_attempts: Optional[int] = field(default=None)
Expand Down

0 comments on commit 11d9fd9

Please sign in to comment.