How to use cloudform - 10 common examples

To help you get started, we’ve selected a few cloudform examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matthewkeil / nomad-devops / dist / aws / cloudfront / ClientDistribution.js View on Github external
}
        },
        DefaultRootObject: "index.html",
        Enabled: true,
        HttpVersion: "http2",
        // Logging: {
        //     IncludeCookies: false,
        //     Bucket: '', // TODO:
        //     Prefix: '' // TODO:
        // },
        Origins: [
            {
                Id: "s3Origin",
                DomainName: cloudform_1.Fn.GetAtt("ClientBucket", "DomainName"),
                S3OriginConfig: {
                    OriginAccessIdentity: cloudform_1.Fn.Join("/", [
                        "origin-access-identity/cloudfront",
                        cloudform_1.Fn.Ref("ClientOriginAccessIdentity")
                    ])
                }
            }
        ],
        PriceClass: "PriceClass_100",
        ViewerCertificate: {
            AcmCertificateArn: cloudform_1.Fn.ImportValue(`${lib_1.pascalCaseDomainName(config_1.config.ROOT_DOMAIN)}Certificate`),
            MinimumProtocolVersion: "TLSv1.1_2016",
            SslSupportMethod: "sni-only"
        }
    }
}).dependsOn(["ClientBucket", "ClientOriginAccessIdentity"]);
github matthewkeil / nomad-devops / aws / cloudfront / ClientDistribution.ts View on Github external
DefaultRootObject: "index.html",
        Enabled: true,
        HttpVersion: "http2",
        // Logging: {
        //     IncludeCookies: false,
        //     Bucket: '', // TODO:
        //     Prefix: '' // TODO:
        // },
        Origins: [
            {
                Id: "s3Origin",
                DomainName: Fn.GetAtt("ClientBucket", "DomainName"),
                S3OriginConfig: {
                    OriginAccessIdentity: Fn.Join("/", [
                        "origin-access-identity/cloudfront",
                        Fn.Ref("ClientOriginAccessIdentity")
                    ])
                }
            }
        ],
        PriceClass: "PriceClass_100", // PriceClass_100 | PriceClass_200 | PriceClass_All
        ViewerCertificate: {
            AcmCertificateArn: Fn.ImportValue(
                `${pascalCaseDomainName(config.ROOT_DOMAIN)}Certificate`
            ),
            MinimumProtocolVersion: "TLSv1.1_2016",
            SslSupportMethod: "sni-only"
        }
    }
}).dependsOn(["ClientBucket", "ClientOriginAccessIdentity"]);
github matthewkeil / nomad-devops / aws / server.ts View on Github external
if (branch === "master") {
        (template.Resources as any).RecordSet = ServerRecordSet;
        (template.Resources as any).DomainName = DomainName;

        (template as any).Outputs.DistributionDomainName = {
            Description: "DomainName.DistributionDomainName for api branch RecordSet to reference",
            Value: Fn.GetAtt("DomainName", "DistributionDomainName"),
            Export: {
                Name: `${pascalCaseDomainName(config.ROOT_DOMAIN)}DistributionDomainName`
            }
        };

        (template as any).Outputs.DistributionHostedZoneId = {
            Description:
                "DomainName.DistributionHostedZoneId for api branch RecordSet to reference",
            Value: Fn.GetAtt("DomainName", "DistributionHostedZoneId"),
            Export: {
                Name: `${pascalCaseDomainName(config.ROOT_DOMAIN)}DistributionHostedZoneId`
            }
        };
    }

    // const parseSegment = (segment: Handlers, currentPath: string): void =>
    //     Object.entries(segment).forEach(([name, segmentOrRoute]) => {
    //         if (
    //             segmentOrRoute.handler &&
    //             typeof segmentOrRoute.handler === "function"
    //         ) {
    //             const Name = capitalizeFirstLetter(name);

    //             const handlerDefinition = {
    //                 Type: "AWS::Serverless::Function",
github matthewkeil / nomad-devops / aws / server.ts View on Github external
Resources: {
            BasePathMapping: BasePathMapping(branch),
            LogGroup,
            ApiGateway,
            GatewayResponseDefault4XX,
            GatewayResponseDefault5XX
        }
    };

    if (branch === "master") {
        (template.Resources as any).RecordSet = ServerRecordSet;
        (template.Resources as any).DomainName = DomainName;

        (template as any).Outputs.DistributionDomainName = {
            Description: "DomainName.DistributionDomainName for api branch RecordSet to reference",
            Value: Fn.GetAtt("DomainName", "DistributionDomainName"),
            Export: {
                Name: `${pascalCaseDomainName(config.ROOT_DOMAIN)}DistributionDomainName`
            }
        };

        (template as any).Outputs.DistributionHostedZoneId = {
            Description:
                "DomainName.DistributionHostedZoneId for api branch RecordSet to reference",
            Value: Fn.GetAtt("DomainName", "DistributionHostedZoneId"),
            Export: {
                Name: `${pascalCaseDomainName(config.ROOT_DOMAIN)}DistributionHostedZoneId`
            }
        };
    }

    // const parseSegment = (segment: Handlers, currentPath: string): void =>
github matthewkeil / nomad-devops / aws / cloudfront / ClientDistribution.ts View on Github external
Forward: "none"
                }
            }
        },
        DefaultRootObject: "index.html",
        Enabled: true,
        HttpVersion: "http2",
        // Logging: {
        //     IncludeCookies: false,
        //     Bucket: '', // TODO:
        //     Prefix: '' // TODO:
        // },
        Origins: [
            {
                Id: "s3Origin",
                DomainName: Fn.GetAtt("ClientBucket", "DomainName"),
                S3OriginConfig: {
                    OriginAccessIdentity: Fn.Join("/", [
                        "origin-access-identity/cloudfront",
                        Fn.Ref("ClientOriginAccessIdentity")
                    ])
                }
            }
        ],
        PriceClass: "PriceClass_100", // PriceClass_100 | PriceClass_200 | PriceClass_All
        ViewerCertificate: {
            AcmCertificateArn: Fn.ImportValue(
                `${pascalCaseDomainName(config.ROOT_DOMAIN)}Certificate`
            ),
            MinimumProtocolVersion: "TLSv1.1_2016",
            SslSupportMethod: "sni-only"
        }
github matthewkeil / nomad-devops / aws / cloudfront / ClientDistribution.ts View on Github external
}
        },
        DefaultRootObject: "index.html",
        Enabled: true,
        HttpVersion: "http2",
        // Logging: {
        //     IncludeCookies: false,
        //     Bucket: '', // TODO:
        //     Prefix: '' // TODO:
        // },
        Origins: [
            {
                Id: "s3Origin",
                DomainName: Fn.GetAtt("ClientBucket", "DomainName"),
                S3OriginConfig: {
                    OriginAccessIdentity: Fn.Join("/", [
                        "origin-access-identity/cloudfront",
                        Fn.Ref("ClientOriginAccessIdentity")
                    ])
                }
            }
        ],
        PriceClass: "PriceClass_100", // PriceClass_100 | PriceClass_200 | PriceClass_All
        ViewerCertificate: {
            AcmCertificateArn: Fn.ImportValue(
                `${pascalCaseDomainName(config.ROOT_DOMAIN)}Certificate`
            ),
            MinimumProtocolVersion: "TLSv1.1_2016",
            SslSupportMethod: "sni-only"
        }
    }
}).dependsOn(["ClientBucket", "ClientOriginAccessIdentity"]);
github matthewkeil / nomad-devops / aws / cloudfront / ClientDistribution.ts View on Github external
// },
        Origins: [
            {
                Id: "s3Origin",
                DomainName: Fn.GetAtt("ClientBucket", "DomainName"),
                S3OriginConfig: {
                    OriginAccessIdentity: Fn.Join("/", [
                        "origin-access-identity/cloudfront",
                        Fn.Ref("ClientOriginAccessIdentity")
                    ])
                }
            }
        ],
        PriceClass: "PriceClass_100", // PriceClass_100 | PriceClass_200 | PriceClass_All
        ViewerCertificate: {
            AcmCertificateArn: Fn.ImportValue(
                `${pascalCaseDomainName(config.ROOT_DOMAIN)}Certificate`
            ),
            MinimumProtocolVersion: "TLSv1.1_2016",
            SslSupportMethod: "sni-only"
        }
    }
}).dependsOn(["ClientBucket", "ClientOriginAccessIdentity"]);
github matthewkeil / nomad-devops / aws / server.ts View on Github external
//             // @ts-ignore
    //             template.Resources[Name] = handlerDefinition;

    //             return;
    //         }

    //         // recursively parse as a path segment
    //         return parseSegment(segmentOrRoute, `${currentPath}/${name}`);
    //     });

    // const handlers = getHandlers();

    // parseSegment(handlers, "handlers");

    return CF(template);
};
github aws-amplify / amplify-cli / packages / appsync-elasticsearch-transformer / lib / resources.js View on Github external
ResourceFactory.prototype.makeElasticSearchDataSource = function () {
        var logicalName = ResourceFactory.ElasticSearchDomainLogicalID;
        return new appSync_1.default.DataSource({
            ApiId: cloudform_1.Fn.GetAtt(ResourceFactory.GraphQLAPILogicalID, 'ApiId'),
            Name: logicalName,
            Type: 'AMAZON_ELASTICSEARCH',
            ServiceRoleArn: cloudform_1.Fn.GetAtt(ResourceFactory.IAMRoleLogicalID, 'Arn'),
            ElasticsearchConfig: {
                AwsRegion: cloudform_1.Fn.Select(3, cloudform_1.Fn.Split(':', cloudform_1.Fn.GetAtt(logicalName, 'DomainArn'))),
                Endpoint: cloudform_1.Fn.Join('', [
                    'https://',
                    cloudform_1.Fn.GetAtt(logicalName, 'DomainEndpoint')
                ])
            }
        });
    };
    /**
github aws-amplify / amplify-cli / packages / amplify-graphql-elasticsearch-transformer / lib / resources.js View on Github external
ResourceFactory.prototype.makeElasticSearchDataSource = function () {
        var logicalName = amplify_graphql_transformer_common_1.ResourceConstants.RESOURCES.ElasticSearchDomainLogicalID;
        return new appSync_1.default.DataSource({
            ApiId: cloudform_1.Fn.GetAtt(amplify_graphql_transformer_common_1.ResourceConstants.RESOURCES.GraphQLAPILogicalID, 'ApiId'),
            Name: logicalName,
            Type: 'AMAZON_ELASTICSEARCH',
            ServiceRoleArn: cloudform_1.Fn.GetAtt(amplify_graphql_transformer_common_1.ResourceConstants.RESOURCES.ElasticSearchAccessIAMRoleLogicalID, 'Arn'),
            ElasticsearchConfig: {
                AwsRegion: cloudform_1.Fn.Select(3, cloudform_1.Fn.Split(':', cloudform_1.Fn.GetAtt(logicalName, 'DomainArn'))),
                Endpoint: cloudform_1.Fn.Join('', [
                    'https://',
                    cloudform_1.Fn.GetAtt(logicalName, 'DomainEndpoint')
                ])
            }
        });
    };
    /**