

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS::Serverless::LayerVersion
<a name="sam-resource-layerversion"></a>

Lambda 함수에 필요한 라이브러리 또는 런타임 코드를 포함하는 Lambda LayerVersion을 생성합니다.

[AWS::Serverless::LayerVersion](#sam-resource-layerversion) 리소스는 `Metadata` 리소스 속성도 지원하므로에 애플리케이션에 포함된 계층을 빌드 AWS SAM 하도록 지시할 수 있습니다. 레이어 구축에 대한 자세한 내용은 [에서 Lambda 계층 빌드 AWS SAM](building-layers.md) 섹션을 참조하세요.

**중요 참고**:에서 [UpdateReplacePolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) 리소스 속성이 릴리스된 이후 CloudFormation[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html) (권장)는와 동일한 이점을 제공합니다[AWS::Serverless::LayerVersion](#sam-resource-layerversion).

서버리스 LayerVersion이 변환되면 SAM은 리소스의 논리적 ID도 변환하여 리소스가 업데이트될 때 CloudFormation이 이전 LayerVersion을 자동으로 삭제하지 않도록 합니다.

**참고**  
에 배포하면가 AWS SAM 리소스를 CloudFormation 리소스로 AWS CloudFormation AWS SAM 변환합니다. 자세한 내용은 [에 대해 생성된 CloudFormation 리소스 AWS SAM](sam-specification-generated-resources.md) 단원을 참조하십시오.

## 구문
<a name="sam-resource-layerversion-syntax"></a>

 AWS Serverless Application Model (AWS SAM) 템플릿에서이 개체를 선언하려면 다음 구문을 사용합니다.

### YAML
<a name="sam-resource-layerversion-syntax.yaml"></a>

```
Type: AWS::Serverless::LayerVersion
Properties:
  [CompatibleArchitectures](#sam-layerversion-compatiblearchitectures): List
  [CompatibleRuntimes](#sam-layerversion-compatibleruntimes): List
  [ContentUri](#sam-layerversion-contenturi): String | LayerContent
  [Description](#sam-layerversion-description): String
  [LayerName](#sam-layerversion-layername): String
  [LicenseInfo](#sam-layerversion-licenseinfo): String
  [PublishLambdaVersion](#sam-layerversion-PublishLambdaVersion): Boolean
  [RetentionPolicy](#sam-layerversion-retentionpolicy): String
```

## 속성
<a name="sam-resource-layerversion-properties"></a>

 `CompatibleArchitectures`   <a name="sam-layerversion-compatiblearchitectures"></a>
레이어 버전에 지원되는 명령어 세트 아키텍처를 지정합니다.  
이 속성에 대한 자세한 내용은 *AWS Lambda 개발자 가이드*의 [Lambda 명령 세트 아키텍처](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)를 참조하세요.  
*유효한 값*: `x86_64`, `arm64`   
*유형*: 목록  
*필수 항목 여부*: 아니요  
*기본값*: `x86_64`  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` 리소스의 `[CompatibleArchitectures](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-compatiblearchitectures)` 속성으로 직접 전달됩니다.

 `CompatibleRuntimes`   <a name="sam-layerversion-compatibleruntimes"></a>
이 LayerVersion과 호환되는 런타임 목록.  
*유형*: 목록  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` 리소스의 `[CompatibleRuntimes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-compatibleruntimes)` 속성으로 직접 전달됩니다.

 `ContentUri`   <a name="sam-layerversion-contenturi"></a>
Amazon S3 Uri, 로컬 폴더 경로 또는 레이어 코드의 레이어 콘텐츠 객체.  
Amazon S3 Uri 또는 LayerContent 객체가 제공되는 경우 참조되는 Amazon S3 객체는 [Lambda 레이어](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)의 콘텐츠를 포함하는 유효한 ZIP 아카이브여야 합니다.  
로컬 폴더 경로가 제공되는 경우 콘텐츠가 제대로 변환되려면 템플릿은 [sam build](sam-cli-command-reference-sam-build.md) 및 그 다음으로 [sam deploy](sam-cli-command-reference-sam-deploy.md) 또는 [sam package](sam-cli-command-reference-sam-package.md) 중 하나가 포함된 워크플로를 거쳐야 합니다. 기본적으로 상대 경로는 AWS SAM 템플릿의 위치와 관련하여 확인됩니다.  
*유형*: 문자열 \$1 [레이어 콘텐츠](sam-property-layerversion-layercontent.md)  
*필수 여부*: 예  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` 리소스의 `[Content](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-content)` 속성과 유사합니다. 중첩된 Amazon S3 속성은 다르게 지정됩니다.

 `Description`   <a name="sam-layerversion-description"></a>
이 레이어에 대한 설명.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` 리소스의 `[Description](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-description)` 속성으로 직접 전달됩니다.

 `LayerName`   <a name="sam-layerversion-layername"></a>
레이어의 이름 또는 Amazon 리소스 이름(ARN)입니다.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*기본값*: 리소스 논리적 ID  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` 리소스의 `[LayerName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-layername)` 속성과 유사합니다. 이름을 지정하지 않으면 리소스의 논리적 ID를 이름으로 사용합니다.

 `LicenseInfo`   <a name="sam-layerversion-licenseinfo"></a>
이 Layer Version의 라이선스에 대한 정보.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` 리소스의 `[LicenseInfo](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-licenseinfo)` 속성으로 직접 전달됩니다.

 `PublishLambdaVersion`   <a name="sam-layerversion-PublishLambdaVersion"></a>
참조된 `LayerVersion` 리소스에 변경 사항이 있을 때마다 새 Lambda 버전을 생성하는 옵트인 속성입니다. 연결된 Lambda 함수에서 `AutoPublishAlias` 및 `AutoPublishAliasAllProperties`이(가) 활성화되면, `LayerVersion` 리소스에 대한 변경 사항이 있을 때마다 새 Lambda 버전이 생성됩니다.  
*유형*: 부울  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은에 고유 AWS SAM 하며 CloudFormation 동등한 속성이 없습니다.

 `RetentionPolicy`   <a name="sam-layerversion-retentionpolicy"></a>
이 속성은 리소스를 삭제할 때 `LayerVersion`의 이전 버전을 유지할지, 아니면 삭제할지 여부를 지정합니다. 리소스를 업데이트하거나 교체할 때 `LayerVersion`의 이전 버전을 유지해야 하는 경우 `UpdateReplacePolicy` 속성을 활성화해야 합니다. 이를 수행하는 방법에 대한 자세한 내용은AWS CloudFormation 사용 설명서**의 [`UpdateReplacePolicy` 속성](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html)을 참조하세요.  
*유효한 값*: `Retain` 또는 `Delete`  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은에 고유 AWS SAM 하며 CloudFormation 동등한 속성이 없습니다.  
*추가 참고* 사항:를 지정하면 변환된 `AWS::Lambda::LayerVersion` 리소스`DeletionPolicy: Retain`에 [에서 지원하는 리소스 속성 AWS SAM](sam-specification-resource-attributes.md)의가 `Retain` AWS SAM 추가됩니다.

## 반환 값
<a name="sam-resource-layerversion-return-values"></a>

### Ref
<a name="sam-resource-layerversion-return-values-ref"></a>

`Ref` 내장 함수에 이 리소스의 논리적 ID를 입력하면 기저의 Lambda LayerVertion의 리소스 ARN을 반환합니다.

`Ref` 함수의 사용에 대한 자세한 내용은 *AWS CloudFormation 사용자 가이드*의 [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html) 섹션을 참조하세요.

## 예제
<a name="sam-resource-layerversion--examples"></a>

### LayerVersionExample
<a name="sam-resource-layerversion--examples--layerversionexample"></a>

레이어 버전 예제

#### YAML
<a name="sam-resource-layerversion--examples--layerversionexample--yaml"></a>

```
Properties:
  LayerName: MyLayer
  Description: Layer description
  ContentUri: 's3://sam-s3-demo-bucket/my-layer.zip'
  CompatibleRuntimes:
    - nodejs10.x
    - nodejs12.x
  LicenseInfo: 'Available under the MIT-0 license.'
  RetentionPolicy: Retain
```

# LayerContent
<a name="sam-property-layerversion-layercontent"></a>

[Lambda 계층](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)의 내용을 포함하는 ZIP 아카이브입니다.

## 구문
<a name="sam-property-layerversion-layercontent-syntax"></a>

 AWS Serverless Application Model (AWS SAM) 템플릿에서이 개체를 선언하려면 다음 구문을 사용합니다.

### YAML
<a name="sam-property-layerversion-layercontent-syntax.yaml"></a>

```
  [Bucket](#sam-layerversion-layercontent-bucket): String
  [Key](#sam-layerversion-layercontent-key): String
  [Version](#sam-layerversion-layercontent-version): String
```

## 속성
<a name="sam-property-layerversion-layercontent-properties"></a>

 `Bucket`   <a name="sam-layerversion-layercontent-bucket"></a>
계층 아카이브의 Amazon S3 버킷입니다.  
*유형*: 문자열  
*필수 항목 여부:* 예  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` `Content` 데이터 유형의 `[S3Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3bucket)` 속성으로 직접 전달됩니다.

 `Key`   <a name="sam-layerversion-layercontent-key"></a>
계층 아카이브의 Amazon S3 키입니다.  
*유형*: 문자열  
*필수 항목 여부:* 예  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` `Content` 데이터 유형의 `[S3Key](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3key)` 속성으로 직접 전달됩니다.

 `Version`   <a name="sam-layerversion-layercontent-version"></a>
버전이 지정된 객체의 경우 사용할 레이어 아카이브 객체의 버전입니다.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Lambda::LayerVersion` `Content` 데이터 유형의 `[S3ObjectVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3objectversion)` 속성으로 직접 전달됩니다.

## 예제
<a name="sam-property-layerversion-layercontent--examples"></a>

### LayerContent
<a name="sam-property-layerversion-layercontent--examples--layercontent"></a>

계층 콘텐츠 예제

#### YAML
<a name="sam-property-layerversion-layercontent--examples--layercontent--yaml"></a>

```
LayerContent:
  Bucket: amzn-s3-demo-bucket-name
  Key: mykey-name
  Version: 121212
```