{
    "componentChunkName": "component---node-modules-rocketseat-gatsby-theme-docs-core-src-templates-docs-query-js",
    "path": "/docs/setup/ec2",
    "result": {"data":{"mdx":{"id":"cedcc09b-e824-5d5d-9091-f05b3e1200a9","excerpt":"In this tutorial, we will demonstrate how to set up  AWS Distro for OpenTelemetry Collector (ADOT Collector) on\nAmazon Elastic Computer Cloud(EC2) to collect…","fields":{"slug":"/docs/setup/ec2/"},"frontmatter":{"title":"Setting up AWS Distro for OpenTelemetry Collector in Amazon Elastic Computer Cloud","description":"In this tutorial, we will demonstrate how to set up  AWS Distro for OpenTelemetry Collector (ADOT Collector) on Amazon Elastic Computer Cloud(EC2) to collect application metrics. Note: This tutorial will set up ADOT Collector on an Amazon EC2 instance in _us-west-2_ with a provided CloudFormation template. if you want to run the example in the other AWS regions, please replace AMI ID in CloudFormation template we provided. ","image":null,"disableTableOfContents":null},"body":"var _excluded = [\"components\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"title\": \"Setting up AWS Distro for OpenTelemetry Collector in Amazon Elastic Computer Cloud\",\n  \"description\": \"In this tutorial, we will demonstrate how to set up  AWS Distro for OpenTelemetry Collector (ADOT Collector) on Amazon Elastic Computer Cloud(EC2) to collect application metrics. Note: This tutorial will set up ADOT Collector on an Amazon EC2 instance in _us-west-2_ with a provided CloudFormation template. if you want to run the example in the other AWS regions, please replace AMI ID in CloudFormation template we provided. \",\n  \"path\": \"/docs/setup/ec2\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"In this tutorial, we will demonstrate how to set up  AWS Distro for OpenTelemetry Collector (ADOT Collector) on\\nAmazon Elastic Computer Cloud(EC2) to collect application metrics.\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Note\"), \"\\nThis tutorial will set up ADOT Collector on an Amazon EC2 instance in \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"us-west-2\"), \" with a provided CloudFormation\\ntemplate. if you want to run the example in the other AWS regions, please replace AMI ID in CloudFormation template we provided.\"), mdx(SectionSeparator, {\n    mdxType: \"SectionSeparator\"\n  }), mdx(\"h2\", {\n    \"id\": \"create-iam-policy\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#create-iam-policy\",\n    \"aria-label\": \"create iam policy permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Create IAM Policy\"), mdx(\"p\", null, \"See the \", mdx(Link, {\n    to: \"/docs/setup/permissions\",\n    mdxType: \"Link\"\n  }, \"Permissions\"), \" section for the permissions required and IAM policy setup steps.\"), mdx(SectionSeparator, {\n    mdxType: \"SectionSeparator\"\n  }), mdx(\"h2\", {\n    \"id\": \"attach-the-iam-policy\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#attach-the-iam-policy\",\n    \"aria-label\": \"attach the iam policy permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Attach the IAM Policy\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Open the \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://console.aws.amazon.com/iam/\"\n  }, \"IAM console\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"In the navigation pane, choose \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Roles\"), \", and then choose \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Create role\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"In the Select type of trusted entity section, choose \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"AWS service\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"For \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Choose a use case\"), \", select \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"EC2\"), \", then choose \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Next: Permission\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"For \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Attach permissions policies\"), \", choose the policy \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"AWSDistroOpenTelemetryPolicy\"), \", and then choose \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Next: Tags\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Choose \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Next: Review\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"On the Review page, type \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"AWSDistroOpenTelemetryRole\"), \" for the Name, and then choose \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Create role\"), \".\")), mdx(SectionSeparator, {\n    mdxType: \"SectionSeparator\"\n  }), mdx(\"h2\", {\n    \"id\": \"install-aws-distro-for-opentelemetry-collector-on-ec2-instance-using-cloudformation\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#install-aws-distro-for-opentelemetry-collector-on-ec2-instance-using-cloudformation\",\n    \"aria-label\": \"install aws distro for opentelemetry collector on ec2 instance using cloudformation permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Install AWS Distro for OpenTelemetry Collector on EC2 instance using CloudFormation\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Download the CloudFormation template file \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"aws-otel-ec2-deployment-cfn.yaml\"), \" for installing ADOT Collector on  Amazon EC2.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\"\n  }, \"curl -O https://raw.githubusercontent.com/aws-observability/aws-otel-collector/main/deployment-template/ec2/aws-otel-ec2-deployment-cfn.yaml\\n\")), mdx(\"ol\", {\n    \"start\": 2\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Replace the below parameters and then run AWS CloudFormation CLI command. It will launch one EC2 instance with ADOT Collector installed.\", mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"ec2-ssh-key-name\"), \" - the key pair name for login to EC2 instance\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"template_path\"), \" - the local location where CloudFormation template file is downloaded in step 1\")))), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-console\",\n    \"metastring\": \"lineNumbers=true\",\n    \"lineNumbers\": \"true\"\n  }, \"Region=us-west-2\\nIAMRole=AWSDistroOpenTelemetryRole\\nEC2Key=<*ec2**-**ssh**-**key**-**name*>\\naws cloudformation create-stack --stack-name AOCEC2-Test \\\\\\n    --template-body file://<*template_path*>/aws-otel-ec2-deployment-cfn.yaml \\\\\\n    --parameters ParameterKey=IAMRole,ParameterValue=${IAMRole} \\\\\\n                 ParameterKey=KeyName,ParameterValue=${EC2Key} \\\\\\n    --capabilities CAPABILITY_NAMED_IAM \\\\\\n    --region ${Region}\\n\")), mdx(\"ol\", {\n    \"start\": 3\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Go to Amazon EC2 Console and verify there is a new EC2 instance that has been launched.\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Select the instance, and then choose \", mdx(\"em\", {\n    parentName: \"li\"\n  }, \"Connect. \"), \"You can login to the EC2 host with the example command below.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\"\n  }, \"ssh -i \\\"<ec2-ssh-key-name>.pem\\\" ec2-user@ec2-<instance_id>.us-west-2.compute.amazonaws.com (mailto:ec2-user@ec2-34-221-1-180.us-west-2.compute.amazonaws.com)\\n\")), mdx(\"ol\", {\n    \"start\": 5\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Check if  ADOT Collector is set up and running on the new EC2 instance. If it is, you\\u2019ll see the following status.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\"\n  }, \"sudo /opt/aws/aws-otel-collector/bin/aws-otel-collector-ctl -a status\\n\")), mdx(\"img\", {\n    src: img10,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  }), mdx(\"div\", {\n    style: {\n      \"height\": \"40px\"\n    }\n  }), mdx(SectionSeparator, {\n    mdxType: \"SectionSeparator\"\n  }), mdx(\"h2\", {\n    \"id\": \"install-aws-distro-for-opentelemetry-collector-on-ec2-instance-using-aws-systems-manager-distributor\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#install-aws-distro-for-opentelemetry-collector-on-ec2-instance-using-aws-systems-manager-distributor\",\n    \"aria-label\": \"install aws distro for opentelemetry collector on ec2 instance using aws systems manager distributor permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Install AWS Distro for OpenTelemetry Collector on EC2 instance using AWS Systems Manager Distributor\"), mdx(\"p\", null, \"AWS Systems Manager Distributor can simplify and scale distribution, installation, and update process of software package, such as AWS Distro for OpenTelemetry Collector. With Distributor, you manage your software packages from a centralized location. Software packages are securely stored in Systems Manager, providing a centralized repository with version control. You can use Run Command to install AWS Distro for OpenTelemetry Collector on demand, or you can use State Manager to update AWS Distro for OpenTelemetry Collector on target instances automatically or on a schedule.\"), mdx(\"p\", null, \"To use \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://docs.aws.amazon.com/systems-manager/latest/userguide/distributor.html\"\n  }, \"AWS Systems Manager Distributor\"), \" to install ADOT Collector on EC2 instances, the target EC2 instances need to meet following requirements.\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"SSM agent version 2.3.1550.0 or later installed\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Permissions Policy \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"AmazonSSMManagedInstanceCore\"), \" attached in IAM Role of EC2 instance\")), mdx(\"p\", null, \"To install AWSDistroOTel-Collector package using AWS Systems Manager Distributor.\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Based on your preferences, prepare AWS Distro for OpenTelemetry Collector YAML configuration file according to \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/aws-observability/aws-otel-collector/#aws-otel-collector-configuration\"\n  }, \"ADOT Collector Configuration\"), \".\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"SSM parameter doesn't support mulit-line text as String Type. So encode AWS Distro for OpenTelemetry Collector YAML configuration file as Base64 and copy the Base64 string to a new SSM parameter in \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://us-west-2.console.aws.amazon.com/systems-manager/parameters/\"\n  }, \"SSM Parameter Store\"), \". Listed below are examples to do Base64 encoding:\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Linux: \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"base64 -w0 config.yaml > aoc-config-base64.txt\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Windows: \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"certutil.exe -f -encodehex config.yaml aoc-config-base64.txt 0x40000001\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"MacOSX: \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"base64 -i config.yaml -o aoc-config-base64.txt\"), \" \")))), mdx(\"img\", {\n    src: imgSSM1,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  }), mdx(\"ol\", {\n    \"start\": 3\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Navigate to the \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://console.aws.amazon.com/systems-manager/distributor\"\n  }, \"SSM Distributor\"), \" console and open the \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Owned by Amazon\"), \" tab. Select \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"AWSDistroOTel-Collector\"), \" and choose \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Install one time\"), \".\"), mdx(\"img\", {\n    src: imgSSM2,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  })), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Update the SSM parameter you created in the first step by replacing \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Additional Arguments\"), \" with the following (e.g. SSM parameter name is \\\"aoc-config-base64\\\"):\"))), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\"\n  }, \"{\\\"SSM_CONFIG\\\": \\\"{{ssm:aoc-config-base64}}\\\"}\\n\")), mdx(\"img\", {\n    src: imgSSM3,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  }), mdx(\"ol\", {\n    \"start\": 5\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Continue to select the EC2 instances by EC2 instance tags, EC2 instance IDs or Resource Group in \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Targets\"), \" and click \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Run\"), \" button to start installation. Visit \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://docs.aws.amazon.com/systems-manager/latest/userguide/distributor-working-with-packages-deploy.html\"\n  }, \"Install or update packages\"), \" for more installation options.\", mdx(\"img\", {\n    src: imgSSM4,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  }))), mdx(\"p\", null, \"To install AWSDistroOTel-Collector package on EC2 instances of Auto Scaling groups. \"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Navigate to the \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://console.aws.amazon.com/systems-manager/distributor\"\n  }, \"SSM Distributor\"), \" console and open the \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Owned by Amazon\"), \" tab. Select \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"AWSDistroOTel-Collector\"), \" and choose \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Install on a schedule\"), \".\"), mdx(\"img\", {\n    src: imgSSM5,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  })), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Update the SSM parameter you created in the previous step by replacing \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Additional Arguments\"), \" with the following (e.g. SSM parameter name is \\\"aoc-config-base64\\\"):\"))), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\"\n  }, \"{\\\"SSM_CONFIG\\\": \\\"{{ssm:aoc-config-base64}}\\\"}\\n\")), mdx(\"img\", {\n    src: imgSSM6,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  }), mdx(\"ol\", {\n    \"start\": 3\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Select \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Specify instance tags\"), \" in \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Targets\"), \". Add \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"aws:autoscaling:groupName\"), \" as Tag key and name of Auto Scaling group as Tag value. In this example, the name of Auto Scaling group is \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"my-first-asg\"), \".\"), mdx(\"img\", {\n    src: imgSSM7,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  })), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Set schedule in \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Specify schedule\"), \" and default is 30 minutes. So Systems Manager will scan tag of Auto Scaling group and install AWSDistroOTel-Collector package in new EC2 instances every 30 minutes.\"), mdx(\"img\", {\n    src: imgSSM8,\n    alt: \"Diagram\",\n    style: {\n      \"margin\": \"30px 0\"\n    }\n  }))), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Notes\")), mdx(\"p\", null, \"The SSM distributor creates an environment file at \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"/opt/aws/aws-otel-collector/etc/.env\"), \" . Any environment variable that will be used in the \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://opentelemetry.io/docs/collector/configuration/#configuration-environment-variables\"\n  }, \"open telemetry configuration\"), \" needs to be added to this file.\"), mdx(\"p\", null, \"After you finished the tutorial, remember to shut down the new EC2 instance we created in the tutorial in order to avoid additional charges.\"));\n}\n;\nMDXContent.isMDXComponent = true;","headings":[{"depth":2,"value":"Create IAM Policy"},{"depth":2,"value":"Attach the IAM Policy"},{"depth":2,"value":"Install AWS Distro for OpenTelemetry Collector on EC2 instance using CloudFormation"},{"depth":2,"value":"Install AWS Distro for OpenTelemetry Collector on EC2 instance using AWS Systems Manager Distributor"}]}},"pageContext":{"slug":"/docs/setup/ec2/","repositoryEditUrl":"https://github.com/rocketseat/gatsby-themes/tree/main/examples/gatsby-theme-docs/src/docs/setup/ec2.mdx","repositoryProvider":"GitHub"}},
    "staticQueryHashes": ["2501019404","973074209"]}