<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://izara.io/wiki/index.php?action=history&amp;feed=atom&amp;title=Initial_setup</id>
	<title>Initial setup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://izara.io/wiki/index.php?action=history&amp;feed=atom&amp;title=Initial_setup"/>
	<link rel="alternate" type="text/html" href="https://izara.io/wiki/index.php?title=Initial_setup&amp;action=history"/>
	<updated>2026-05-02T05:29:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://izara.io/wiki/index.php?title=Initial_setup&amp;diff=2556&amp;oldid=prev</id>
		<title>Praew: Created page with &quot;== set initail setup == * set dynamodb table &lt;syntaxhighlight lang=&quot;JavaScript&quot;&gt; module.exports.tableConfigs = {   Config: {     // serviceName: serviceNameRbac,     //tableName: 'UserRoles', // can overwrite tableName here   },   ProductRecord: {     // serviceName: initialSetupConfig.serviceNameProductManager,    },   RolePermissions: {     serviceName: initialSetupConfig.serviceNameRbac,    },   //... } &lt;/syntaxhighlight&gt;  * set subscription topic &lt;syntaxhighlight lan...&quot;</title>
		<link rel="alternate" type="text/html" href="https://izara.io/wiki/index.php?title=Initial_setup&amp;diff=2556&amp;oldid=prev"/>
		<updated>2023-10-19T01:27:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== set initail setup == * set dynamodb table &amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot;&amp;gt; module.exports.tableConfigs = {   Config: {     // serviceName: serviceNameRbac,     //tableName: &amp;#039;UserRoles&amp;#039;, // can overwrite tableName here   },   ProductRecord: {     // serviceName: initialSetupConfig.serviceNameProductManager,    },   RolePermissions: {     serviceName: initialSetupConfig.serviceNameRbac,    },   //... } &amp;lt;/syntaxhighlight&amp;gt;  * set subscription topic &amp;lt;syntaxhighlight lan...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== set initail setup ==&lt;br /&gt;
* set dynamodb table&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
module.exports.tableConfigs = {&lt;br /&gt;
  Config: {&lt;br /&gt;
    // serviceName: serviceNameRbac,&lt;br /&gt;
    //tableName: 'UserRoles', // can overwrite tableName here&lt;br /&gt;
  },&lt;br /&gt;
  ProductRecord: {&lt;br /&gt;
    // serviceName: initialSetupConfig.serviceNameProductManager,&lt;br /&gt;
&lt;br /&gt;
  },&lt;br /&gt;
  RolePermissions: {&lt;br /&gt;
    serviceName: initialSetupConfig.serviceNameRbac,&lt;br /&gt;
&lt;br /&gt;
  },&lt;br /&gt;
  //...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* set subscription topic&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
/** service name for create subscription topic */&lt;br /&gt;
module.exports.snsTopicSubscriptions = [&lt;br /&gt;
  {&lt;br /&gt;
    serviceName: initialSetupConfig.serviceNameProductManager,&lt;br /&gt;
    topicName: &amp;quot;OutServiceComplete&amp;quot;,&lt;br /&gt;
    sqsEndpoint: &amp;quot;ProcessProduct&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  //...&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* set seed data for dynamodb&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
module.exports.seedDynamodbConfig = () =&amp;gt; {&lt;br /&gt;
  let seedDataGroup = [&lt;br /&gt;
    {&lt;br /&gt;
	    configKey: &amp;quot;ProductGraphServiceName&amp;quot;,&lt;br /&gt;
      configTag: &amp;quot;ProductGraphServiceName&amp;quot;,&lt;br /&gt;
	    configValue: &amp;quot;ProductGraph&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
	    configKey: &amp;quot;ProductHandlerServiceNameTag&amp;quot;,&lt;br /&gt;
	    configTag: &amp;quot;ProductHandlerServiceNameTag&amp;quot;,&lt;br /&gt;
	    configValue: {&lt;br /&gt;
		    serviceName: &amp;quot;ProductStandard&amp;quot;&lt;br /&gt;
	    }&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
  return seedDataGroup;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* set IAM role for external lambda&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
/** IAM role for external lambda */&lt;br /&gt;
module.exports.lambdaRoleConfigs = () =&amp;gt; {&lt;br /&gt;
&lt;br /&gt;
  //* add more role for external service action, if have&lt;br /&gt;
     {&lt;br /&gt;
       functionName: 'CreateProductApi', // roleName exceed 64&lt;br /&gt;
       statement: [&lt;br /&gt;
         {&lt;br /&gt;
           // &amp;quot;Sid&amp;quot;: &amp;quot;GenerateSeedGraphTestEnvInvokeStatement&amp;quot;,&lt;br /&gt;
           &amp;quot;Effect&amp;quot;: &amp;quot;Allow&amp;quot;,&lt;br /&gt;
           &amp;quot;Action&amp;quot;: [&lt;br /&gt;
             'SNS:Publish'&lt;br /&gt;
           ],&lt;br /&gt;
           &amp;quot;Resource&amp;quot;: [&lt;br /&gt;
             //other&lt;br /&gt;
           ],&lt;br /&gt;
         },&lt;br /&gt;
       ]&lt;br /&gt;
     },&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add role if want to testing integrationtest&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
// // // ------add role if want to testing integrationtest&lt;br /&gt;
  // // // NOTE: dont remember to add varible: resourcePrefixIntTest&lt;br /&gt;
  if (initialSetupConfig.resourcePrefixIntTest) {&lt;br /&gt;
&lt;br /&gt;
    const functionsToAddPermission = [&lt;br /&gt;
      &amp;quot;CreateProductApi&amp;quot;,&lt;br /&gt;
      // &amp;quot;anotherLambda&amp;quot;,&lt;br /&gt;
    ];&lt;br /&gt;
&lt;br /&gt;
    for (const functionToAddPermission of functionsToAddPermission) {&lt;br /&gt;
      let roleForIntTest = {&lt;br /&gt;
        functionName: functionToAddPermission,&lt;br /&gt;
        statement: [&lt;br /&gt;
          {&lt;br /&gt;
            &amp;quot;Sid&amp;quot;: functionToAddPermission + &amp;quot;SnsStatement&amp;quot;,&lt;br /&gt;
            &amp;quot;Effect&amp;quot;: &amp;quot;Allow&amp;quot;,&lt;br /&gt;
            &amp;quot;Action&amp;quot;: [&lt;br /&gt;
              'SNS:Publish'&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;Resource&amp;quot;: [&lt;br /&gt;
              snsSharedLib.snsTopicArn(&amp;quot;InIntTestInput&amp;quot;, initialSetupConfig.resourcePrefixIntTest),&lt;br /&gt;
              snsSharedLib.snsTopicArn(&amp;quot;InIntTestOutput&amp;quot;, initialSetupConfig.resourcePrefixIntTest),&lt;br /&gt;
              snsSharedLib.snsTopicArn(&amp;quot;InIntTestInvInput&amp;quot;, initialSetupConfig.resourcePrefixIntTest),&lt;br /&gt;
              snsSharedLib.snsTopicArn(&amp;quot;InIntTestInvOutput&amp;quot;, initialSetupConfig.resourcePrefixIntTest),],&lt;br /&gt;
          },&lt;br /&gt;
        ]&lt;br /&gt;
      }&lt;br /&gt;
      // if (roleForIntTest.functionName == )&lt;br /&gt;
      returnArray.push(roleForIntTest)&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Praew</name></author>
	</entry>
</feed>