Exemplo n.º 1
0
    def __init__(
        self,
        arn: str,
        codeuri: Optional[str],
        compatible_runtimes: Optional[List[str]] = None,
        metadata: Optional[Dict] = None,
        stack_path: str = "",
    ) -> None:
        """
        Parameters
        ----------
        stack_path str
            The path of the stack relative to the root stack, it is empty for layers in root stack
        name str
            Name of the layer, this can be the ARN or Logical Id in the template
        codeuri str
            CodeURI of the layer. This should contain the path to the layer code
        """
        if compatible_runtimes is None:
            compatible_runtimes = []
        if metadata is None:
            metadata = {}
        if not isinstance(arn, str):
            raise UnsupportedIntrinsic(
                "{} is an Unsupported Intrinsic".format(arn))

        self._stack_path = stack_path
        self._arn = arn
        self._codeuri = codeuri
        self.is_defined_within_template = bool(codeuri)
        self._build_method = cast(Optional[str],
                                  metadata.get("BuildMethod", None))
        self._compatible_runtimes = compatible_runtimes
Exemplo n.º 2
0
    def __init__(self, arn, codeuri, compatible_runtimes=None, metadata=None):
        """
        Parameters
        ----------
        name str
            Name of the layer, this can be the ARN or Logical Id in the template
        codeuri str
            CodeURI of the layer. This should contain the path to the layer code
        """
        if compatible_runtimes is None:
            compatible_runtimes = []
        if metadata is None:
            metadata = {}
        if not isinstance(arn, str):
            raise UnsupportedIntrinsic(
                "{} is an Unsupported Intrinsic".format(arn))

        self._arn = arn
        self._codeuri = codeuri
        self.is_defined_within_template = bool(codeuri)
        self._name = LayerVersion._compute_layer_name(
            self.is_defined_within_template, arn)
        self._version = LayerVersion._compute_layer_version(
            self.is_defined_within_template, arn)
        self._build_method = metadata.get("BuildMethod", None)
        self._compatible_runtimes = compatible_runtimes
Exemplo n.º 3
0
    def __init__(self, arn, codeuri):
        """

        Parameters
        ----------
        name str
            Name of the layer, this can be the ARN or Logical Id in the template
        codeuri str
            CodeURI of the layer. This should contain the path to the layer code
        """
        if not isinstance(arn, six.string_types):
            raise UnsupportedIntrinsic("{} is an Unsupported Intrinsic".format(arn))

        self._arn = arn
        self._codeuri = codeuri
        self.is_defined_within_template = bool(codeuri)
        self._name = LayerVersion._compute_layer_name(self.is_defined_within_template, arn)
        self._version = LayerVersion._compute_layer_version(self.is_defined_within_template, arn)