

지원 종료 공지: 2026년 10월 7일에는에 대한 지원을 중단할 AWS 예정입니다 AWS IoT Greengrass Version 1. 2026년 10월 7일 이후에는 더 이상 AWS IoT Greengrass V1 리소스에 액세스할 수 없습니다. 자세한 내용은 [에서 마이그레이션 AWS IoT Greengrass Version 1](https://docs.aws.amazon.com/greengrass/v2/developerguide/migrate-from-v1.html)을 참조하세요.

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

# CloudFormation 에 대한 지원 AWS IoT Greengrass
<a name="cloudformation-support"></a>

CloudFormation 는 AWS 리소스를 생성, 관리 및 복제하는 데 도움이 되는 서비스입니다. CloudFormation 템플릿을 사용하여 배포하려는 AWS IoT Greengrass 그룹과 클라이언트 디바이스, 구독 및 기타 구성 요소를 정의할 수 있습니다. 예제는 [템플릿 예제](#cloudformation-support-example) 섹션을 참조하세요.

템플릿에서 생성하는 리소스와 인프라를 *스택*이라고 합니다. 모든 리소스를 하나의 템플릿에서 정의하거나 다른 스택의 리소스를 참조할 수 있습니다. CloudFormation 템플릿 및 기능에 대한 자세한 내용은 [란 무엇입니까 CloudFormation?](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)를 참조하세요. *AWS CloudFormation 사용 설명서*의 .

## 리소스 생성
<a name="cloudformation-support-create"></a>

CloudFormation 템플릿은 AWS 리소스의 속성과 관계를 설명하는 JSON 또는 YAML 문서입니다. 다음 AWS IoT Greengrass 리소스가 지원됩니다.
+ 그룹
+ 코어
+ 클라이언트 장치(장치)
+ Lambda 함수
+ 커넥터
+ 리소스(로컬, 기계 학습, 비밀)
+ 구독
+ 로거(로깅 구성)

 CloudFormation 템플릿에서 Greengrass 리소스의 구조와 구문은 AWS IoT Greengrass API를 기반으로 합니다. 예를 들어, 이 [예제 템플릿](#cloudformation-support-example)은 최상위 수준 `DeviceDefinition`을 개별 클라이언트 장치가 포함된 `DeviceDefinitionVersion`과 연결합니다. 자세한 내용은 [AWS IoT Greengrass 그룹 객체 모델 개요](deployments.md#api-overview) 단원을 참조하십시오.

*AWS CloudFormation 사용 설명서*의 [AWS IoT Greengrass 리소스 유형 참조](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Greengrass.html)에서는 관리할 수 있는 Greengrass 리소스를 설명합니다 CloudFormation. CloudFormation 템플릿을 사용하여 Greengrass 리소스를 생성할 때는 해당 리소스만 관리하는 것이 좋습니다 CloudFormation. 예를 들어, ( AWS IoT Greengrass API 또는 AWS IoT 콘솔을 사용하는 대신) 디바이스를 추가, 변경 또는 제거하려면 템플릿을 업데이트해야 합니다. 이렇게 하면 롤백 및 기타 CloudFormation 변경 관리 기능을 사용할 수 있습니다. CloudFormation 를 사용하여 리소스 및 스택을 생성하고 관리하는 방법에 대한 자세한 내용은 *AWS CloudFormation 사용 설명서*[의 스택 작업을](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacks.html) 참조하세요.

 CloudFormation 템플릿에서 AWS IoT Greengrass 리소스를 생성하고 배포하는 방법을 보여주는 연습은 AWS 공식 블로그의 사물 인터넷에서 [를 사용하여 AWS IoT Greengrass 설정 자동화 CloudFormation](https://aws.amazon.com/blogs/iot/automating-aws-iot-greengrass-setup-with-aws-cloudformation/)를 참조하세요.

## 리소스 배포
<a name="cloudformation-support-deploy"></a>

그룹 버전이 포함된 CloudFormation 스택을 생성한 후 AWS CLI 또는 AWS IoT 콘솔을 사용하여 배포할 수 있습니다.

**참고**  
그룹을 배포하려면와 연결된 Greengrass 서비스 역할이 있어야 합니다 AWS 계정. 서비스 역할을 통해는 AWS Lambda 및 기타 AWS 서비스의 리소스에 AWS IoT Greengrass 액세스할 수 있습니다. 현재 AWS 리전에서 Greengrass 그룹을 이미 배포한 경우 이 역할이 존재해야 합니다. 자세한 내용은 [Greengrass 서비스 역할](service-role.md) 단원을 참조하십시오.

**그룹을 배포하려면(AWS CLI)**  
+ [https://docs.aws.amazon.com/greengrass/v1/apireference/createdeployment-post.html](https://docs.aws.amazon.com/greengrass/v1/apireference/createdeployment-post.html) 명령을 실행합니다.

  ```
  aws greengrass create-deployment --group-id {{GroupId}} --group-version-id {{GroupVersionId}} --deployment-type NewDeployment
  ```
**참고**  
[예제 템플릿](#cloudformation-support-example)의 `CommandToDeployGroup` 명령문은 스택을 생성할 때 그룹 및 그룹 버전 ID와 함께 명령을 출력하는 방법을 보여줍니다.

**그룹을 배포하려면(콘솔)**  

1. <a name="console-gg-groups"></a> AWS IoT 콘솔 탐색 창의 **관리**에서 **Greengrass 디바이스**를 확장한 다음 **그룹(V1)을** 선택합니다.

1. 그룹을 선택합니다.

1. <a name="console-actions-deploy"></a>그룹 구성 페이지에서 **배포**를 선택합니다.

## 템플릿 예제
<a name="cloudformation-support-example"></a>

다음 예제 템플릿은 코어, 클라이언트 장치, 함수, 로거, 구독 및 두 개의 리소스가 포함된 Greengrass 그룹을 생성합니다. 이를 위해 템플릿은 AWS IoT Greengrass API의 객체 모델을 따릅니다. 예를 들어, 그룹에 추가하려는 클라이언트 장치가 `DeviceDefinition` 리소스와 연결된 `DeviceDefinitionVersion` 리소스에 포함되어 있는 경우, 장치를 그룹에 추가하기 위해 그룹 버전은 `DeviceDefinitionVersion`의 ARN을 참조합니다.

템플릿에는 코어 및 디바이스의 인증서 ARNs과 소스 Lambda 함수( AWS Lambda 리소스)의 버전 ARN을 지정할 수 있는 파라미터가 포함되어 있습니다. 이 템플릿은 `Ref` 및 `GetAtt` 내장 함수를 사용하여 Greengrass 리소스를 생성하는 데 필요한 ID, ARN 및 기타 속성을 참조합니다.

템플릿은 Greengrass 그룹에 추가된 코어 및 클라이언트 AWS IoT 디바이스를 나타내는 두 개의 디바이스(사물)도 정의합니다.

Greengrass 리소스로 스택을 생성한 후 AWS CLI 또는 AWS IoT 콘솔을 사용하여 [그룹을 배포할 수 있습니다](#cloudformation-support-deploy).

**참고**  
예제의 `CommandToDeployGroup` 문은 그룹을 배포하는 데 사용할 수 있는 전체 **create-deployment** CLI 명령을 출력하는 방법을 보여 줍니다.

------
#### [ JSON ]

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "AWS IoT Greengrass example template that creates a group version with a core, device, function, logger, subscription, and resources.",
    "Parameters": {
        "CoreCertificateArn": {
            "Type": "String"
        },
        "DeviceCertificateArn": {
            "Type": "String"
        },
        "LambdaVersionArn": {
            "Type": "String"
        }
    },
    "Resources": {
        "TestCore1": {
            "Type": "AWS::IoT::Thing",
            "Properties": {
                "ThingName": "TestCore1"
            }
        },
        "TestCoreDefinition": {
            "Type": "AWS::Greengrass::CoreDefinition",
            "Properties": {
                "Name": "DemoTestCoreDefinition"
            }
        },
        "TestCoreDefinitionVersion": {
            "Type": "AWS::Greengrass::CoreDefinitionVersion",
            "Properties": {
                "CoreDefinitionId": {
                    "Ref": "TestCoreDefinition"
                },
                "Cores": [
                    {
                        "Id": "TestCore1",
                        "CertificateArn": {
                            "Ref": "CoreCertificateArn"
                        },
                        "SyncShadow": "false",
                        "ThingArn": {
                            "Fn::Join": [
                                ":",
                                [
                                    "arn:aws:iot",
                                    {
                                        "Ref": "AWS::Region"
                                    },
                                    {
                                        "Ref": "AWS::AccountId"
                                    },
                                    "thing/TestCore1"
                                ]
                            ]
                        }
                    }
                ]
            }
        },
        "TestClientDevice1": {
            "Type": "AWS::IoT::Thing",
            "Properties": {
                "ThingName": "TestClientDevice1"
            }
        },
        "TestDeviceDefinition": {
            "Type": "AWS::Greengrass::DeviceDefinition",
            "Properties": {
                "Name": "DemoTestDeviceDefinition"
            }
        },
        "TestDeviceDefinitionVersion": {
            "Type": "AWS::Greengrass::DeviceDefinitionVersion",
            "Properties": {
                "DeviceDefinitionId": {
                    "Fn::GetAtt": [
                        "TestDeviceDefinition",
                        "Id"
                    ]
                },
                "Devices": [
                    {
                        "Id": "TestClientDevice1",
                        "CertificateArn": {
                            "Ref": "DeviceCertificateArn"
                        },
                        "SyncShadow": "true",
                        "ThingArn": {
                            "Fn::Join": [
                                ":",
                                [
                                    "arn:aws:iot",
                                    {
                                        "Ref": "AWS::Region"
                                    },
                                    {
                                        "Ref": "AWS::AccountId"
                                    },
                                    "thing/TestClientDevice1"
                                ]
                            ]
                        }
                    }
                ]
            }
        },
        "TestFunctionDefinition": {
            "Type": "AWS::Greengrass::FunctionDefinition",
            "Properties": {
                "Name": "DemoTestFunctionDefinition"
            }
        },
        "TestFunctionDefinitionVersion": {
            "Type": "AWS::Greengrass::FunctionDefinitionVersion",
            "Properties": {
                "FunctionDefinitionId": {
                    "Fn::GetAtt": [
                        "TestFunctionDefinition",
                        "Id"
                    ]
                },
                "DefaultConfig": {
                    "Execution": {
                        "IsolationMode": "GreengrassContainer"
                    }
                },
                "Functions": [
                    {
                        "Id": "TestLambda1",
                        "FunctionArn": {
                            "Ref": "LambdaVersionArn"
                        },
                        "FunctionConfiguration": {
                            "Pinned": "true",
                            "Executable": "run.exe",
                            "ExecArgs": "argument1",
                            "MemorySize": "512",
                            "Timeout": "2000",
                            "EncodingType": "binary",
                            "Environment": {
                                "Variables": {
                                    "variable1": "value1"
                                },
                                "ResourceAccessPolicies": [
                                    {
                                        "ResourceId": "ResourceId1",
                                        "Permission": "ro"
                                    },
                                    {
                                        "ResourceId": "ResourceId2",
                                        "Permission": "rw"
                                    }
                                ],
                                "AccessSysfs": "false",
                                "Execution": {
                                    "IsolationMode": "GreengrassContainer",
                                    "RunAs": {
                                        "Uid": "1",
                                        "Gid": "10"
                                    }
                                }
                            }
                        }
                    }
                ]
            }
        },
        "TestLoggerDefinition": {
            "Type": "AWS::Greengrass::LoggerDefinition",
            "Properties": {
                "Name": "DemoTestLoggerDefinition"
            }
        },
        "TestLoggerDefinitionVersion": {
            "Type": "AWS::Greengrass::LoggerDefinitionVersion",
            "Properties": {
                "LoggerDefinitionId": {
                    "Ref": "TestLoggerDefinition"
                },
                "Loggers": [
                    {
                        "Id": "TestLogger1",
                        "Type": "AWSCloudWatch",
                        "Component": "GreengrassSystem",
                        "Level": "INFO"
                    }
                ]
            }
        },
        "TestResourceDefinition": {
            "Type": "AWS::Greengrass::ResourceDefinition",
            "Properties": {
                "Name": "DemoTestResourceDefinition"
            }
        },
        "TestResourceDefinitionVersion": {
            "Type": "AWS::Greengrass::ResourceDefinitionVersion",
            "Properties": {
                "ResourceDefinitionId": {
                    "Ref": "TestResourceDefinition"
                },
                "Resources": [
                    {
                        "Id": "ResourceId1",
                        "Name": "LocalDeviceResource",
                        "ResourceDataContainer": {
                            "LocalDeviceResourceData": {
                                "SourcePath": "/dev/TestSourcePath1",
                                "GroupOwnerSetting": {
                                    "AutoAddGroupOwner": "false",
                                    "GroupOwner": "TestOwner"
                                }
                            }
                        }
                    },
                    {
                        "Id": "ResourceId2",
                        "Name": "LocalVolumeResourceData",
                        "ResourceDataContainer": {
                            "LocalVolumeResourceData": {
                                "SourcePath": "/dev/TestSourcePath2",
                                "DestinationPath": "/volumes/TestDestinationPath2",
                                "GroupOwnerSetting": {
                                    "AutoAddGroupOwner": "false",
                                    "GroupOwner": "TestOwner"
                                }
                            }
                        }
                    }
                ]
            }
        },
        "TestSubscriptionDefinition": {
            "Type": "AWS::Greengrass::SubscriptionDefinition",
            "Properties": {
                "Name": "DemoTestSubscriptionDefinition"
            }
        },
        "TestSubscriptionDefinitionVersion": {
            "Type": "AWS::Greengrass::SubscriptionDefinitionVersion",
            "Properties": {
                "SubscriptionDefinitionId": {
                    "Ref": "TestSubscriptionDefinition"
                },
                "Subscriptions": [
                    {
                        "Id": "TestSubscription1",
                        "Source": {
                            "Fn::Join": [
                                ":",
                                [
                                    "arn:aws:iot",
                                    {
                                        "Ref": "AWS::Region"
                                    },
                                    {
                                        "Ref": "AWS::AccountId"
                                    },
                                    "thing/TestClientDevice1"
                                ]
                            ]
                        },
                        "Subject": "TestSubjectUpdated",
                        "Target": {
                            "Ref": "LambdaVersionArn"
                        }
                    }
                ]
            }
        },
        "TestGroup": {
            "Type": "AWS::Greengrass::Group",
            "Properties": {
                "Name": "DemoTestGroupNewName",
                "RoleArn": {
                    "Fn::Join": [
                        ":",
                        [
                            "arn:aws:iam:",
                            {
                                "Ref": "AWS::AccountId"
                            },
                            "role/TestUser"
                        ]
                    ]
                },
                "InitialVersion": {
                    "CoreDefinitionVersionArn": {
                        "Ref": "TestCoreDefinitionVersion"
                    },
                    "DeviceDefinitionVersionArn": {
                        "Ref": "TestDeviceDefinitionVersion"
                    },
                    "FunctionDefinitionVersionArn": {
                        "Ref": "TestFunctionDefinitionVersion"
                    },
                    "SubscriptionDefinitionVersionArn": {
                        "Ref": "TestSubscriptionDefinitionVersion"
                    },
                    "LoggerDefinitionVersionArn": {
                        "Ref": "TestLoggerDefinitionVersion"
                    },
                    "ResourceDefinitionVersionArn": {
                        "Ref": "TestResourceDefinitionVersion"
                    }
                },
                "Tags": {
                    "KeyName0": "value",
                    "KeyName1": "value",
                    "KeyName2": "value"
                }
            }
        }
    },
    "Outputs": {
        "CommandToDeployGroup": {
            "Value": {
                "Fn::Join": [
                    " ",
                    [
                        "groupVersion=$(cut -d'/' -f6 <<<",
                        {
                            "Fn::GetAtt": [
                                "TestGroup",
                                "LatestVersionArn"
                            ]
                        },
                        ");",
                        "aws --region",
                        {
                            "Ref": "AWS::Region"
                        },
                        "greengrass create-deployment --group-id",
                        {
                            "Ref": "TestGroup"
                        },
                        "--deployment-type NewDeployment --group-version-id",
                        "$groupVersion"
                    ]
                ]
            }
        }
    }
}
```

------
#### [ YAML ]

```
AWSTemplateFormatVersion: 2010-09-09
Description: >-
  AWS IoT Greengrass example template that creates a group version with a core,
  device, function, logger, subscription, and resources.
Parameters:
  CoreCertificateArn:
    Type: String
  DeviceCertificateArn:
    Type: String
  LambdaVersionArn:
    Type: String
Resources:
  TestCore1:
    Type: 'AWS::IoT::Thing'
    Properties:
      ThingName: TestCore1
  TestCoreDefinition:
    Type: 'AWS::Greengrass::CoreDefinition'
    Properties:
      Name: DemoTestCoreDefinition
  TestCoreDefinitionVersion:
    Type: 'AWS::Greengrass::CoreDefinitionVersion'
    Properties:
      CoreDefinitionId: !Ref TestCoreDefinition
      Cores:
        - Id: TestCore1
          CertificateArn: !Ref CoreCertificateArn
          SyncShadow: 'false'
          ThingArn: !Join 
            - ':'
            - - 'arn:aws:iot'
              - !Ref 'AWS::Region'
              - !Ref 'AWS::AccountId'
              - thing/TestCore1
  TestClientDevice1:
    Type: 'AWS::IoT::Thing'
    Properties:
      ThingName: TestClientDevice1
  TestDeviceDefinition:
    Type: 'AWS::Greengrass::DeviceDefinition'
    Properties:
      Name: DemoTestDeviceDefinition
  TestDeviceDefinitionVersion:
    Type: 'AWS::Greengrass::DeviceDefinitionVersion'
    Properties:
      DeviceDefinitionId: !GetAtt 
        - TestDeviceDefinition
        - Id
      Devices:
        - Id: TestClientDevice1
          CertificateArn: !Ref DeviceCertificateArn
          SyncShadow: 'true'
          ThingArn: !Join 
            - ':'
            - - 'arn:aws:iot'
              - !Ref 'AWS::Region'
              - !Ref 'AWS::AccountId'
              - thing/TestClientDevice1
  TestFunctionDefinition:
    Type: 'AWS::Greengrass::FunctionDefinition'
    Properties:
      Name: DemoTestFunctionDefinition
  TestFunctionDefinitionVersion:
    Type: 'AWS::Greengrass::FunctionDefinitionVersion'
    Properties:
      FunctionDefinitionId: !GetAtt 
        - TestFunctionDefinition
        - Id
      DefaultConfig:
        Execution:
          IsolationMode: GreengrassContainer
      Functions:
        - Id: TestLambda1
          FunctionArn: !Ref LambdaVersionArn
          FunctionConfiguration:
            Pinned: 'true'
            Executable: run.exe
            ExecArgs: argument1
            MemorySize: '512'
            Timeout: '2000'
            EncodingType: binary
            Environment:
              Variables:
                variable1: value1
              ResourceAccessPolicies:
                - ResourceId: ResourceId1
                  Permission: ro
                - ResourceId: ResourceId2
                  Permission: rw
              AccessSysfs: 'false'
              Execution:
                IsolationMode: GreengrassContainer
                RunAs:
                  Uid: '1'
                  Gid: '10'
  TestLoggerDefinition:
    Type: 'AWS::Greengrass::LoggerDefinition'
    Properties:
      Name: DemoTestLoggerDefinition
  TestLoggerDefinitionVersion:
    Type: 'AWS::Greengrass::LoggerDefinitionVersion'
    Properties:
      LoggerDefinitionId: !Ref TestLoggerDefinition
      Loggers:
        - Id: TestLogger1
          Type: AWSCloudWatch
          Component: GreengrassSystem
          Level: INFO
  TestResourceDefinition:
    Type: 'AWS::Greengrass::ResourceDefinition'
    Properties:
      Name: DemoTestResourceDefinition
  TestResourceDefinitionVersion:
    Type: 'AWS::Greengrass::ResourceDefinitionVersion'
    Properties:
      ResourceDefinitionId: !Ref TestResourceDefinition
      Resources:
        - Id: ResourceId1
          Name: LocalDeviceResource
          ResourceDataContainer:
            LocalDeviceResourceData:
              SourcePath: /dev/TestSourcePath1
              GroupOwnerSetting:
                AutoAddGroupOwner: 'false'
                GroupOwner: TestOwner
        - Id: ResourceId2
          Name: LocalVolumeResourceData
          ResourceDataContainer:
            LocalVolumeResourceData:
              SourcePath: /dev/TestSourcePath2
              DestinationPath: /volumes/TestDestinationPath2
              GroupOwnerSetting:
                AutoAddGroupOwner: 'false'
                GroupOwner: TestOwner
  TestSubscriptionDefinition:
    Type: 'AWS::Greengrass::SubscriptionDefinition'
    Properties:
      Name: DemoTestSubscriptionDefinition
  TestSubscriptionDefinitionVersion:
    Type: 'AWS::Greengrass::SubscriptionDefinitionVersion'
    Properties:
      SubscriptionDefinitionId: !Ref TestSubscriptionDefinition
      Subscriptions:
        - Id: TestSubscription1
          Source: !Join 
            - ':'
            - - 'arn:aws:iot'
              - !Ref 'AWS::Region'
              - !Ref 'AWS::AccountId'
              - thing/TestClientDevice1
          Subject: TestSubjectUpdated
          Target: !Ref LambdaVersionArn
  TestGroup:
    Type: 'AWS::Greengrass::Group'
    Properties:
      Name: DemoTestGroupNewName
      RoleArn: !Join 
        - ':'
        - - 'arn:aws:iam:'
          - !Ref 'AWS::AccountId'
          - role/TestUser
      InitialVersion:
        CoreDefinitionVersionArn: !Ref TestCoreDefinitionVersion
        DeviceDefinitionVersionArn: !Ref TestDeviceDefinitionVersion
        FunctionDefinitionVersionArn: !Ref TestFunctionDefinitionVersion
        SubscriptionDefinitionVersionArn: !Ref TestSubscriptionDefinitionVersion
        LoggerDefinitionVersionArn: !Ref TestLoggerDefinitionVersion
        ResourceDefinitionVersionArn: !Ref TestResourceDefinitionVersion
      Tags:
        KeyName0: value
        KeyName1: value
        KeyName2: value
Outputs:
  CommandToDeployGroup:
    Value: !Join 
      - ' '
      - - groupVersion=$(cut -d'/' -f6 <<<
        - !GetAtt 
          - TestGroup
          - LatestVersionArn
        - );
        - aws --region
        - !Ref 'AWS::Region'
        - greengrass create-deployment --group-id
        - !Ref TestGroup
        - '--deployment-type NewDeployment --group-version-id'
        - $groupVersion
```

------

## 지원되는 AWS 리전
<a name="cloudformation-support-regions"></a>

현재 다음 에서만 AWS IoT Greengrass 리소스를 생성하고 관리할 수 [AWS 리전있습니다.](https://docs.aws.amazon.com/general/latest/gr/greengrass.html)
+ 미국 동부(오하이오)
+ 미국 동부(버지니아 북부)
+ 미국 서부(오리건)
+ 아시아 태평양(뭄바이)
+ 아시아 태평양(서울)
+ 아시아 태평양(싱가포르)
+ 아시아 태평양(시드니)
+ 아시아 태평양(도쿄)
+ 중국(베이징)
+ 유럽(프랑크푸르트)
+ 유럽(아일랜드)
+ 유럽(런던)
+ AWS GovCloud(미국 서부)