<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Manualsnapshot &#8211; Cognivtech</title>
	<atom:link href="https://blog.cognivtech.com/tag/manualsnapshot/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.cognivtech.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Jun 2025 07:41:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://blog.cognivtech.com/wp-content/uploads/2025/06/cropped-cogniv-logo-32x32.png</url>
	<title>Manualsnapshot &#8211; Cognivtech</title>
	<link>https://blog.cognivtech.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Manual Snapshot in AWS OpenSearch</title>
		<link>https://blog.cognivtech.com/manual-snapshot-implementation-in-amazon-opensearch-service/</link>
					<comments>https://blog.cognivtech.com/manual-snapshot-implementation-in-amazon-opensearch-service/#comments</comments>
		
		<dc:creator><![CDATA[Karthick]]></dc:creator>
		<pubDate>Tue, 24 Jun 2025 07:16:18 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[Manualsnapshot]]></category>
		<category><![CDATA[Opensearch]]></category>
		<guid isPermaLink="false">https://blog.cognivtech.com/?p=335</guid>

					<description><![CDATA[Executive:   Amazon OpenSearch Service provides robust mechanisms for snapshot backups, which are essential for disaster recovery, migrations, and compliance. While automated snapshots are handled internally by AWS, there are use cases where manual snapshots become necessary to meet custom requirements, especially during cross-cloud migrations or external recovery strategies.  The Challenge:  One of our clients [&#8230;]]]></description>
										<content:encoded><![CDATA[<h4><b><span data-contrast="auto">Executive: </span></b><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:281,&quot;335559739&quot;:281}"> </span></h4>
<p><span data-contrast="auto">Amazon OpenSearch Service provides robust mechanisms for snapshot backups, which are essential for disaster recovery, migrations, and compliance. While automated snapshots are handled internally by AWS, there are use cases where manual snapshots become necessary to meet custom requirements, especially during cross-cloud migrations or external recovery strategies.</span><span data-ccp-props="{}"> </span></p>
<h4><b><span data-contrast="auto">The Challenge:</span></b><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:281,&quot;335559739&quot;:281}"> </span></h4>
<p><span data-contrast="auto">One of our clients faced a limitation with OpenSearch’s def</span><span data-contrast="auto">ault automated snapshot feature.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<h4><b><span data-contrast="auto">Scenario:</span></b></h4>
<p><span data-contrast="auto"> The client was preparing to migrate from AWS to Azure, and while OpenSearch automated snapshots were available, they did not meet the granularity or portability required for such a transition.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<h4><b><span data-contrast="auto">Problem:</span></b><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></h4>
<p><span data-contrast="auto">Automated snapshots are stored in an AWS-managed repository. </span><span data-contrast="auto">Direct access or export of these snapshots outside AWS is not supported.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span><span data-contrast="auto">The client needed full control over the snapshots, including the ability to store and manage them in a customer-owned S3 bucket.</span></p>
<h4><strong>The Solution:</strong></h4>
<p><span data-contrast="auto">To overcome this limitation, Cogniv implemented a manual snapshot strategy using OpenSearch&#8217;s snapshot APIs, with the snapshots stored in a custom-managed Amazon S3 bucket.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="9" data-list-defn-props="{&quot;335552541&quot;:1,&quot;335559683&quot;:0,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}" data-aria-posinset="1" data-aria-level="1"><span data-contrast="auto">Full ownership and visibility of backup data</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></li>
</ul>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="9" data-list-defn-props="{&quot;335552541&quot;:1,&quot;335559683&quot;:0,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}" data-aria-posinset="2" data-aria-level="1"><span data-contrast="auto">Greater flexibility for cross-cloud migration</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></li>
</ul>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="9" data-list-defn-props="{&quot;335552541&quot;:1,&quot;335559683&quot;:0,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}" data-aria-posinset="3" data-aria-level="1"><span data-contrast="auto">The ability to script, schedule, and manage snapshots as needed</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></li>
</ul>
<h4><strong>Prerequisites:</strong></h4>
<ul data-start="145" data-end="537">
<li data-start="145" data-end="244">
<p data-start="147" data-end="244">An S3 bucket must be created in the same AWS region where the OpenSearch domain is provisioned.</p>
</li>
<li data-start="245" data-end="324">
<p data-start="247" data-end="324">An EC2 instance should be running in the same VPC as the OpenSearch domain.</p>
</li>
<li data-start="325" data-end="422">
<p data-start="327" data-end="422">The EC2 instance must have an IAM role attached with permissions to access S3 and OpenSearch.</p>
</li>
<li data-start="423" data-end="537">
<p data-start="425" data-end="537">Access to the Dev Tools section in the OpenSearch Dashboard is required to register and trigger snapshots.</p>
</li>
</ul>
<h4><b><span data-contrast="auto">Implementation of manual snapshot: </span></b><span data-ccp-props="{}"> </span></h4>
<h4><b><span data-contrast="auto">Step 1 : Creating a required IAM Role </span></b><span data-ccp-props="{}"> </span></h4>
<p><b><span data-contrast="auto">Create an IAM role with below two policies  </span></b><span data-ccp-props="{}"> </span></p>
<p><b><span data-contrast="auto">         </span></b><span data-contrast="auto">Policy Name: PutToOpenSearchAndPassRolePolicy &amp; </span>S3FullAccessToSpecificBucketPolicy</p>
<p><b><span data-contrast="auto">Policy 1 &#8211; PutToOpenSearchAndPassRolePolicy</span></b><span data-contrast="auto">                       </span><span data-ccp-props="{}"> </span></p>
<p><b><span data-contrast="auto">Description:</span></b><br />
<span data-contrast="auto"> This policy allows a principal to upload data to an Amazon OpenSearch Service domain using HTTP PUT and to pass a designated IAM role. This is typically used in scenarios where a service needs to write logs or data to OpenSearch and assumes a role for execution.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<p><span data-ccp-props="{}"> </span><span data-contrast="auto">This policy is for interacting with an Amazon OpenSearch domain and passing an IAM role:</span><br />
<span data-contrast="auto">{</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    &#8220;Version&#8221;: &#8220;2012-10-17&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    &#8220;Statement&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        {</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Effect&#8221;: &#8220;Allow&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Action&#8221;: &#8220;iam:PassRole&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Resource&#8221;: &#8220;arn:aws:iam::&lt;account-id&gt;:role/&lt;role-name&gt;&#8221;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        },</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        {</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Effect&#8221;: &#8220;Allow&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Action&#8221;: &#8220;es:ESHttpPut&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Resource&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                &#8220;arn:aws:es:&lt;region&gt;:&lt;account-id&gt;:domain/&lt;domain-name&gt;/*&#8221;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            ]</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        }</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    ]</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">}</span><span data-ccp-props="{}"> </span></p>
<p><b><span data-contrast="none">Policy-2 : S3FullAccessToSpecificBucketPolicy</span></b><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:319,&quot;335559739&quot;:319}"> </span></p>
<p><b><span data-contrast="auto">Description:</span></b><br />
<span data-contrast="auto"> Grants permission to list, read, upload, and delete objects in a specific Amazon S3 bucket. This is commonly used for services or applications that manage file storage within a single bucket.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<p><span data-contrast="auto">{</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    &#8220;Version&#8221;: &#8220;2012-10-17&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    &#8220;Statement&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        {</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Effect&#8221;: &#8220;Allow&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Action&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                &#8220;s3:ListBucket&#8221;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            ],</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Resource&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                &#8220;arn:aws:s3:::&lt;bucket-name&gt;&#8221;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            ]</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        },</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        {</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Effect&#8221;: &#8220;Allow&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Action&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                &#8220;s3:GetObject&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                &#8220;s3:PutObject&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                &#8220;s3:DeleteObject&#8221;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            ],</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Resource&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                &#8220;arn:aws:s3:::&lt;bucket-name&gt;/*&#8221;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            ]</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        }</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    ]</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">}</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            </span></p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-336" src="https://blog.cognivtech.com/wp-content/uploads/2025/06/IAM-policy.png" alt="" width="1477" height="109" /></p>
<h4><b><span data-contrast="auto"> Step 2 : Update the trust policy of the created IAM role</span></b><span data-ccp-props="{}"> </span></h4>
<p><span data-contrast="auto">{</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    &#8220;Version&#8221;: &#8220;2012-10-17&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    &#8220;Statement&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        {</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Sid&#8221;: &#8220;&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Effect&#8221;: &#8220;Allow&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Principal&#8221;: {</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                &#8220;Service&#8221;: [</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                    &#8220;es.amazonaws.com&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                    &#8220;ec2.amazonaws.com&#8221;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">                ]</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            },</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">            &#8220;Action&#8221;: &#8220;sts:AssumeRole&#8221;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        }</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    ]</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">}</span><span data-ccp-props="{}"> </span></p>
<p><img decoding="async" class="alignnone size-full wp-image-337" src="https://blog.cognivtech.com/wp-content/uploads/2025/06/Trust-relation.png" alt="" width="1541" height="548" /></p>
<h4><b><span data-contrast="auto">Step 3 : Mapping IAM Role ARN in OpenSearch Dashboard</span></b><span data-ccp-props="{}"> </span></h4>
<p><span data-contrast="auto">     To allow OpenSearch to use the IAM role for snapshot operations, map the created IAM Role ARN to the relevant security roles within the OpenSearch Dashboard.</span><span data-ccp-props="{}"> </span></p>
<p><b><span data-contrast="auto">Navigation Path: </span></b><span data-contrast="auto">Menu → Management → Security → Roles</span><span data-ccp-props="{}"> </span></p>
<p><b><span data-contrast="auto">Instructions:</span></b><span data-ccp-props="{&quot;335559685&quot;:0}"> </span></p>
<p><b><span data-contrast="auto">Map to manage_snapshots Role:</span></b></p>
<ol>
<li><span data-contrast="auto">In the Roles view, search for the role named manage_snapshots[predefined role]</span></li>
</ol>
<p><img decoding="async" class="alignnone size-full wp-image-338" src="https://blog.cognivtech.com/wp-content/uploads/2025/06/Mapped-users-1.png" alt="" width="1319" height="561" /></p>
<p><span class="NormalTextRun SCXW32386493 BCX0">     2. Select the role and </span><span class="NormalTextRun SCXW32386493 BCX0">locate</span><span class="NormalTextRun SCXW32386493 BCX0"> the section </span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW32386493 BCX0">titled </span><span class="NormalTextRun SCXW32386493 BCX0">Mapped users</span></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-339" src="https://blog.cognivtech.com/wp-content/uploads/2025/06/Mapped-users-2.png" alt="" width="1913" height="803" /></p>
<p>3. <span class="TextRun SCXW49050206 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW49050206 BCX0">Click Edit and add the ARN of the IAM role created for snapshot access.</span></span><span class="EOP SCXW49050206 BCX0" data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-342" src="https://blog.cognivtech.com/wp-content/uploads/2025/06/mapped-user-3-1.png" alt="" width="991" height="467" /></p>
<p><b><span data-contrast="auto">Map to all_access Role:</span></b><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<ul>
<li data-leveltext="%2." data-font="Calibri" data-listid="7" data-list-defn-props="{&quot;335552541&quot;:0,&quot;335559683&quot;:1,&quot;335559684&quot;:-1,&quot;335559685&quot;:1440,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,4,46],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%2.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}" data-aria-posinset="1" data-aria-level="2"><span data-contrast="auto">Similarly, search for the role named all_access.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></li>
</ul>
<ul>
<li data-leveltext="%2." data-font="Calibri" data-listid="7" data-list-defn-props="{&quot;335552541&quot;:0,&quot;335559683&quot;:1,&quot;335559684&quot;:-1,&quot;335559685&quot;:1440,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,4,46],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%2.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}" data-aria-posinset="2" data-aria-level="2"><span data-contrast="auto">Select the role and locate both the Mapped users and Backend roles sections.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></li>
</ul>
<ul>
<li data-leveltext="%2." data-font="Calibri" data-listid="7" data-list-defn-props="{&quot;335552541&quot;:0,&quot;335559683&quot;:1,&quot;335559684&quot;:-1,&quot;335559685&quot;:1440,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,4,46],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%2.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}" data-aria-posinset="3" data-aria-level="2"><span data-contrast="auto">Click Edit for each section and add the same IAM Role ARN.</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></li>
</ul>
<ul>
<li data-leveltext="%2." data-font="Calibri" data-listid="7" data-list-defn-props="{&quot;335552541&quot;:0,&quot;335559683&quot;:1,&quot;335559684&quot;:-1,&quot;335559685&quot;:1440,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,4,46],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%2.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}" data-aria-posinset="4" data-aria-level="2"><span data-contrast="auto">Save the changes.</span></li>
</ul>
<p><span class="TextRun SCXW203657559 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW203657559 BCX0">This mapping ensures that the IAM role has the necessary permissions to interact with OpenSearch and manage snapshot operations via the REST API or CLI.</span></span></p>
<h4><b><span data-contrast="auto">Step 4 : Create a s3 bucket on which the manual snapshot should be stored and keep the bucket as public</span></b><span data-ccp-props="{}"> </span></h4>
<h4><b><span data-contrast="auto">Step 5 : Register OpenSearch Snapshot Repository via Python</span></b><span data-contrast="auto"> </span></h4>
<p><span data-contrast="auto">This guide describes how to install the required dependencies and execute a Python script to register a snapshot repository in the OpenSearch Dashboard via its REST API.</span></p>
<p><span data-contrast="auto"><strong>Installation Commands :</strong> </span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">Run the following commands on your EC2 or server to set up the environment:</span><span data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<p><span data-contrast="auto">sudo yum install -y python3</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">sudo yum install -y python3-pip </span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">pip3 install boto3</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">pip3 install requests</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">pip3 install requests_aws4auth</span><span data-ccp-props="{}"> </span></p>
<p><b><span data-contrast="auto">Script : </span></b><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">This script uses the boto3, requests, and requests_aws4auth libraries to register an S3 snapshot repository in Amazon OpenSearch Service.</span><span data-ccp-props="{}"> </span></p>
<p><span data-ccp-props="{}">i</span><span data-contrast="auto">mport boto3</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">import requests</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">from requests_aws4auth import AWS4Auth</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto"> host = &#8216;</span><a href="https://%3Cyour-opensearch-domain-endpoint%3E/"><span data-contrast="auto">https://&lt;your-opensearch-domain-endpoint&gt;/</span></a><span data-contrast="auto">&#8216; </span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">region = &#8216;&lt;aws-region&gt;&#8217;                              </span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">service = &#8216;es&#8217;</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">credentials = boto3.Session().get_credentials()</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">awsauth = AWS4Auth(</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    credentials.access_key,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    credentials.secret_key,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    region,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    service,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    session_token=credentials.token</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">)</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto"> path = &#8216;/_snapshot/&lt;repository-name&gt;&#8217; </span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">url = host + path</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto"> payload = {</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    &#8220;type&#8221;: &#8220;s3&#8221;,</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    &#8220;settings&#8221;: {</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        &#8220;bucket&#8221;: &#8220;&lt;your-s3-bucket-name&gt;&#8221;,                 </span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        &#8220;region&#8221;: &#8220;&lt;aws-region&gt;&#8221;,                          </span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">        &#8220;role_arn&#8221;: &#8220;arn:aws:iam::&lt;account-id&gt;: role/&lt;role-name&gt;&#8221;  </span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">    }</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">}</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">headers = {&#8220;Content-Type&#8221;: &#8220;application/json&#8221;}</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">r = requests.put(url, auth=awsauth, json=payload, headers=headers)</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto"> print(r.status_code)</span><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">print(r.text)</span></p>
<p><span data-contrast="auto">Run this script to register OpenSearch snapshot Repository</span><span data-ccp-props="{}"> </span></p>
<h3><b><span data-contrast="auto">Step 6 : Execute a Manual Snapshot Backup</span></b><span data-ccp-props="{}"> </span></h3>
<p><span data-contrast="auto">To initiate a manual snapshot backup of your OpenSearch indices, use the following REST API command from the OpenSearch Dashboard (Dev Tools )</span></p>
<p><b><span data-contrast="auto">Command Syntax: </span></b><span data-ccp-props="{}"> </span></p>
<p><span data-contrast="auto">PUT /_snapshot/&lt;your-snapshot-repo-name&gt;/&lt;snapshot-name&gt;</span><span data-ccp-props="{}"> </span></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-343" src="https://blog.cognivtech.com/wp-content/uploads/2025/06/Snapshot-command.png" alt="" width="1455" height="638" /></p>
<p><span class="TextRun SCXW154576574 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW154576574 BCX0">To check the </span><span class="NormalTextRun SCXW154576574 BCX0">status,</span><span class="NormalTextRun SCXW154576574 BCX0"> use the following command and run it in the dev tools</span></span><span class="LineBreakBlob BlobObject DragDrop SCXW154576574 BCX0"><span class="SCXW154576574 BCX0"> </span><br class="SCXW154576574 BCX0" /></span><span class="LineBreakBlob BlobObject DragDrop SCXW154576574 BCX0"><span class="SCXW154576574 BCX0"> </span><br class="SCXW154576574 BCX0" /></span><strong><span class="TextRun SCXW154576574 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW154576574 BCX0">Command Syntax: </span></span></strong></p>
<p><span class="TextRun SCXW154576574 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW154576574 BCX0"> GET /_snapshot/_status</span></span><span class="EOP SCXW154576574 BCX0" data-ccp-props="{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240}"> </span></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-344" src="https://blog.cognivtech.com/wp-content/uploads/2025/06/Status.png" alt="" width="1919" height="776" /></p>
<p><span class="TextRun SCXW70665138 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW70665138 BCX0">After running these command manual snapshot will be created and stored in the created s3 </span><span class="NormalTextRun SCXW70665138 BCX0">bucket</span></span><span class="EOP SCXW70665138 BCX0" data-ccp-props="{}"> </span></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-345" src="https://blog.cognivtech.com/wp-content/uploads/2025/06/s3-bucket.png" alt="" width="1487" height="627" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.cognivtech.com/manual-snapshot-implementation-in-amazon-opensearch-service/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
