Skip to content

Instantly share code, notes, and snippets.

View BardiaN's full-sized avatar

Bardia Navvabian BardiaN

View GitHub Profile
@BardiaN
BardiaN / api-cloudformation-template-mildly-compressed.json
Created September 17, 2020 14:12
amplify-cli api-cloudformation-template mildly-compressed
{
"AdminsGroupPATH1Policy": {
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Fn::Join": [
"",
[
"arn:aws:execute-api:",
@BardiaN
BardiaN / api-cloudformation-template-deployed-as-inline-policy-Admins-mildly-compressed.json
Created September 17, 2020 14:08
amplify-cli api-cloudformation-template deployed as inline policy Admins mildly-compressed
{
"[PROJECTNAME][APINAME]-PATH1-group-policy": {
"Version": "2012-10-17",
"Statement": [
{
"Action": ["execute-api:Invoke"],
"Resource": [
"arn:aws:execute-api:[REGION]:[ACCOUNTID]:[APIID]/[ACCOUNTNAME]/*/PATH1/*",
"arn:aws:execute-api:[REGION]:[ACCOUNTID]:[APIID]/[ACCOUNTNAME]/*/PATH1"
],
@BardiaN
BardiaN / api-cloudformation-template-deployed-as-inline-policy-Admins
Created September 17, 2020 13:28
amplify-cli api-cloudformation-template deployed as inline policy-Admins
{
"[PROJECTNAME][APINAME]-PATH1-group-policy": {
"Version": "2012-10-17",
"Statement": [
{
"Action": ["execute-api:Invoke"],
"Resource": [
"arn:aws:execute-api:[REGION]:[ACCOUNTID]:[APIID]/[ACCOUNTNAME]/POST/PATH1/*",
"arn:aws:execute-api:[REGION]:[ACCOUNTID]:[APIID]/[ACCOUNTNAME]/POST/PATH1",
"arn:aws:execute-api:[REGION]:[ACCOUNTID]:[APIID]/[ACCOUNTNAME]/GET/PATH1/*",
@BardiaN
BardiaN / amplify-cli-api-cloudformation-template.json
Last active September 17, 2020 12:35
amplify-cli api-cloudformation-template with groups
{
"AdminsGroupPATH1Policy": {
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Fn::Join": [
"",
[
"arn:aws:execute-api:",
@BardiaN
BardiaN / amplify-cli-lambda-template-json-supporting-queue-template-2.json
Last active September 30, 2019 11:14
amplify-cli-lambda-template-json-supporting-queue-template-2.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Lambda resource stack creation using Amplify CLI",
"Parameters": {
"env": {
"Type": "String"
},
"//Comment1":"... you might have other parameters here like your storage resource name & ARN",
"queueYOUREXACTQUEUENAMEName": {
"Type": "String",
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Lambda resource stack creation using Amplify CLI",
"Parameters": {
"env": {
"Type": "String"
},
"//Comment1":"... you might have other parameters here like your storage resource name & ARN",
"queueYOUREXACTQUEUENAMEName": {
"Type": "String",
{
"//Comment1":"...rest of your backend-config.json",
"YOUR-LAMBDA-NAME": { "//Comment2":"This section must be already here, because you added your lambda function using Amplify CLI",
"service": "Lambda",
"providerPlugin": "awscloudformation",
"build": true,
"dependsOn": [
{"//Comment3":".... Your lambda might already have some other dependencies supported by Amplify CLI"},
{
"category": "queue",
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Queue resource stack creation using Amplify CLI",
"Parameters": {
"env": {
"Type": "String"
}
},
"Conditions": {
"ShouldNotCreateEnvResources": {