You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"1 validation error detected: Value '[{layer_version_arn}]'"
627
630
+r" at 'layers' failed to satisfy constraint: Member must satisfy constraint: [Member must have length less than or equal to 140, Member must have length greater than or equal to 1, Member must satisfy regular expression pattern: (arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+)|(arn:[a-zA-Z0-9-]+:lambda:::awslayer:[a-zA-Z0-9-_]+), Member must not be null]",
f"User: arn:aws:iam::{account_id}:{user} is not authorized to perform: lambda:GetLayerVersion on resource: {layer_version_arn} because no resource-based policy allows the lambda:GetLayerVersion action"
650
656
)
651
-
iflayerisNone:
657
+
iflayerisNoneorlayer_versionisNone:
652
658
# Limitation: cannot fetch external layers when using the same account id as the target layer
653
659
# because we do not want to trigger the layer fetcher for every non-existing layer.
f"User: arn:aws:iam::{account_id}:{user} is not authorized to perform: lambda:GetLayerVersion on resource: {layer_version_arn} because no resource-based policy allows the lambda:GetLayerVersion action"
665
671
)
666
-
state.layers[layer_name] =layer
672
+
673
+
# Distinguish between new layer and new layer version
674
+
iflayer_versionisNone:
675
+
# Create whole layer from scratch
676
+
state.layers[layer_name] =layer
677
+
else:
678
+
# Create layer version if another version of the same layer already exists
679
+
state.layers[layer_name].layer_versions[
680
+
layer_version_str
681
+
] =layer.layer_versions.get(layer_version_str)
667
682
668
683
# only the first two matches in the array are considered for the error message
0 commit comments