All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.wrzasq.lambda.cform.account.Handler Maven / Gradle / Ivy

There is a newer version: 1.1.16
Show newest version
/*
 * This file is part of the pl.wrzasq.lambda.
 *
 * @license http://mit-license.org/ The MIT license
 * @copyright 2019 © by Rafał Wrzeszcz - Wrzasq.pl.
 */

package pl.wrzasq.lambda.cform.account;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.organizations.AWSOrganizations;
import com.amazonaws.services.organizations.AWSOrganizationsClientBuilder;
import com.amazonaws.services.organizations.model.Account;
import com.sunrun.cfnresponse.CfnRequest;
import pl.wrzasq.commons.aws.cloudformation.CustomResourceHandler;
import pl.wrzasq.lambda.cform.account.model.AccountRequest;
import pl.wrzasq.lambda.cform.account.service.AccountManager;

/**
 * CloudFormation request handler.
 *
 * 

Recommended memory: 256MB.

*/ public class Handler { /** * CloudFormation response handler. */ private static CustomResourceHandler handler; static { AWSOrganizations organizations = AWSOrganizationsClientBuilder.defaultClient(); AccountManager deploy = new AccountManager(organizations); Handler.handler = new CustomResourceHandler<>(deploy::provision, deploy::provision, deploy::delete); } /** * Handles invocation. * * @param request CloudFormation request. * @param context AWS Lambda context. */ public void handle(CfnRequest request, Context context) { Handler.handler.handle(request, context); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy