<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Ops Community ⚙️: David Krohn</title>
    <description>The latest articles on The Ops Community ⚙️ by David Krohn (@daknhh).</description>
    <link>https://community.ops.io/daknhh</link>
    <image>
      <url>https://community.ops.io/images/HIEwtx3SaMKh1PkYrJFN3lk--WgrEMm91uizIFvDY_w/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL3Vz/ZXIvcHJvZmlsZV9p/bWFnZS8xMjcvZWI1/YmU0MzctZjJlMC00/N2UxLTkxYzQtNDFm/MzNkMTQyNjgwLnBu/Zw</url>
      <title>The Ops Community ⚙️: David Krohn</title>
      <link>https://community.ops.io/daknhh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.ops.io/feed/daknhh"/>
    <language>en</language>
    <item>
      <title>Deploying CloudFormation StackSets with AWS CDK</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Fri, 21 Jul 2023 07:07:49 +0000</pubDate>
      <link>https://community.ops.io/daknhh/deploying-cloudformation-stacksets-with-aws-cdk-3oba</link>
      <guid>https://community.ops.io/daknhh/deploying-cloudformation-stacksets-with-aws-cdk-3oba</guid>
      <description>&lt;p&gt;AWS Cloud Development Kit (CDK) is a powerful framework that allows developers to define cloud infrastructure as code using familiar programming languages. With CDK, you can easily provision and manage AWS resources in a consistent and automated manner. In this blog post, we'll walk you through the process of creating a StackSet using AWS CDK.&lt;/p&gt;

&lt;p&gt;Before we dive into the details, let's take a quick look at what a StackSet is and how it can help you manage your AWS infrastructure.&lt;/p&gt;

&lt;p&gt;StackSets are containers for CloudFormation stacks that enable simultaneous creation, update, and deletion across multiple AWS accounts and regions. With StacksSets, you can ensure that all environments are consistent and compliant with the policies you have in place.&lt;/p&gt;

&lt;p&gt;The native support for StackSet in CDK is somewhat rudimentary, due to the fact that it is more common in CDK to use &lt;a href="https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines-readme.html"&gt;CDK pipelines&lt;/a&gt; to roll out stacks to multiple accounts and regions.&lt;/p&gt;

&lt;p&gt;Therefore, in order to use StackSet in CDK, a few things need to be considered. In this blogpost, we will show steps on how to deploy StackSets via CDK.&lt;/p&gt;

&lt;p&gt;Let’s see how this works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To follow this tutorial, make sure you have the following prerequisites&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html"&gt;An AWS account with appropriate permissions to create StackSets and associated resources.&lt;/a&gt;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aws.amazon.com/cli/?nc1=h_ls"&gt;AWS Command Line Interface (CLI)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html"&gt;AWS Cloud Development Kit (AWS CDK)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic knowledge of TypeScript&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bootstrap AWS Account
&lt;/h2&gt;

&lt;p&gt;Bootstrapping is the process of providing resources for the AWS CDK before you can deploy AWS CDK applications in an AWS environment. Normally you could use the default&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cdk bootstrap aws://ACCOUNT-NUMBER-1/REGION-1&lt;/code&gt; command. However, we need to customise the template to make the assets available to the entire AWS Organization, as we want to use this CDK environment to deploy StackSets. To get the latest version of the CDK bootstrap template, do the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cdk bootstrap --show-template &amp;gt; bootstrap-template.yaml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ℹ️ The CDK boostrap template contains an S3 bucket for files and an ECR repository for container images. It also creates few IAM roles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/gvLcgYJMpFxQnjNqc2XWNnYKsqrtkIcAHoEAZhY6gJg/w:800/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvZWt5/MDBwdWF3d3RlcGUw/Z3dwa2UucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/gvLcgYJMpFxQnjNqc2XWNnYKsqrtkIcAHoEAZhY6gJg/w:800/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvZWt5/MDBwdWF3d3RlcGUw/Z3dwa2UucG5n" alt="Image description" width="800" height="621"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, we need to modify two resources in this template. The s3 bucket for Assets and the KMS Key that will be used to encrypt the assets.&lt;/p&gt;

&lt;p&gt;Add the following Part to the &lt;strong&gt;Parameters&lt;/strong&gt; Section of the template:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PrincipalOrgID:&lt;br&gt;
        Description: &amp;gt;-&lt;br&gt;
          The identifier of your AWS organization. Used in the KMS key policy and S3 bucket to&lt;br&gt;
          share the key with all accounts under your organization&lt;br&gt;
        Type: String&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We will reference this Parameter in the Resource section.&lt;/p&gt;

&lt;p&gt;Add this CodeSnippet to the &lt;strong&gt;FileAssetsBucketEncryptionKey&lt;/strong&gt; Resource in to the Key Policy Section. This will&lt;/p&gt;

&lt;p&gt;&lt;code&gt;KeyPolicy:&lt;br&gt;
            Statement:&lt;br&gt;
              - Action:&lt;br&gt;
              ....&lt;br&gt;
              - Action:&lt;br&gt;
                  - kms:Decrypt&lt;br&gt;
                  - kms:DescribeKey&lt;br&gt;
                Effect: Allow&lt;br&gt;
                Principal:&lt;br&gt;
                  AWS: "*"&lt;br&gt;
                Resource: "*"&lt;br&gt;
                Condition:&lt;br&gt;
                  StringEquals:&lt;br&gt;
                    kms:ViaService:&lt;br&gt;
                      - Fn::Sub: s3.${AWS::Region}.amazonaws.com&lt;br&gt;
                  ForAnyValue:StringLike:&lt;br&gt;
                    aws:PrincipalOrgID:&lt;br&gt;
                    - !Ref PrincipalOrgID&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Extend the PolicyDocument of the &lt;strong&gt;StagingBucketPolicy&lt;/strong&gt; with the following CodeSnippet. This will ensure that all Accounts of the Organization get access to the objects in the Asset Bucket.&lt;/p&gt;

&lt;p&gt;`          PolicyDocument:&lt;br&gt;
            Id: AccessControl&lt;br&gt;
            Version: "2012-10-17"&lt;br&gt;
            Statement:&lt;br&gt;
            ...&lt;br&gt;
              - Sid: ''&lt;br&gt;
                Effect: Allow&lt;br&gt;
                Principal: '&lt;em&gt;'&lt;br&gt;
                Action:&lt;br&gt;
                - s3:Get&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            Resource: !Sub '${StagingBucket.Arn}/*'
            Condition:
              ForAnyValue:StringLike:
                aws:PrincipalOrgID:
                - !Ref PrincipalOrgID
          - Sid: ''
            Effect: Allow
            Principal: '*'
            Action: s3:ListBucket
            Resource: !Sub '${StagingBucket.Arn}'
            Condition:
              ForAnyValue:StringLike:
                aws:PrincipalOrgID:
                - !Ref PrincipalOrgID`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After all the adjustments we need to deploy the template.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws cloudformation create-stack \&lt;br&gt;
      --stack-name CDKToolkit \&lt;br&gt;
      --template-body file://bootstrap-template.yaml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/08_DXtlLGMOiFDdFsFWuNiSkm84y2jNTkdTM9TPrqPo/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/LzYwMGY4ZDQ0MTQ3/YTljZWViODdhYWJj/Y2U2ZTQ0YjJmN2Y5/N2U5Y2QtMjgweDI4/MC53ZWJw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/08_DXtlLGMOiFDdFsFWuNiSkm84y2jNTkdTM9TPrqPo/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/LzYwMGY4ZDQ0MTQ3/YTljZWViODdhYWJj/Y2U2ZTQ0YjJmN2Y5/N2U5Y2QtMjgweDI4/MC53ZWJw" alt="Blog Content" width="280" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set Up Your CDK Project
&lt;/h2&gt;

&lt;p&gt;After bootstrapping our Account we are ready to Initialize a new CDK project. We will do that in a new directory. The initialisation creates a new CDK project structure with a &lt;code&gt;sample lib/stackset-cdk-demo-stack.ts&lt;/code&gt; file, which we will modify to create our StackSet.&lt;/p&gt;

&lt;p&gt;`    #Create new directory&lt;br&gt;
    mkdir stackset-cdk-demo&lt;br&gt;
    cd stackset-cdk-demo&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Init new CDK Project
cdk init app --language typescript`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Define the StackSet
&lt;/h2&gt;

&lt;p&gt;Open &lt;code&gt;lib/stackset-cdk-demo-stack.ts&lt;/code&gt; and remove the example stack definition. We'll define our stackset instead:&lt;/p&gt;

&lt;p&gt;`    import * as cdk from 'aws-cdk-lib';&lt;br&gt;
    import * as servicecatalog from 'aws-cdk-lib/aws-servicecatalog';&lt;br&gt;
    import { StackSetTemplate } from "./stackSetTemplate";&lt;br&gt;
    import * as s3 from "aws-cdk-lib/aws-s3";&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export class StackSetCdkDemoStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);


    const stackSetTemplateSandbox = new StackSetTemplate(this, "stacksettemplate", {
      Config: props.stacksetProps,
      assetBucket: s3.Bucket.fromBucketName(this, "assetbucket", "myCDKAssetBucket")
    });

    new cdk.CfnStackSet(this, "TESTSTACKSET", {
      permissionModel: "SELF_MANAGED",
      stackSetName: "TEST-STACKSET",
      description:
        "example of StackSet with CDK",
      capabilities: ["CAPABILITY_NAMED_IAM"],
      templateUrl: servicecatalog.CloudFormationTemplate.fromProductStack(stackSetTemplateSandbox).bind(this).httpUrl,
      operationPreferences: {
        failureToleranceCount: 30,
        maxConcurrentCount: 30,
      }
    });
  }
}`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;⚠️ Ensure to adjust the myCDKAssetBucket to your AWS Account Assets Bucket.&lt;/p&gt;

&lt;p&gt;🚨 Using the servicecatalog ProductStack construct we get rid of the PseudoParameter for the assets bucket in lambdas in the template.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ Without using the servicatalog ProductStack:

!sub cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}

✅ Using the servicatalog ProductStack:

cdk-hnb659fds-assets-123456789012-eu-central-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Undefined&lt;/p&gt;

&lt;p&gt;This workaround will ensure that all AWS accounts can access the assets in our CDK app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create StackSet template
&lt;/h2&gt;

&lt;p&gt;In the lib directory create a new file called &lt;strong&gt;&lt;code&gt;stackSetTemplate.ts&lt;/code&gt;&lt;/strong&gt; and add the following code to the file:&lt;br&gt;
`&lt;br&gt;
    import * as cdk from "aws-cdk-lib";&lt;br&gt;
    import { Construct } from "constructs";&lt;br&gt;
    import * as servicecatalog from "aws-cdk-lib/aws-servicecatalog";&lt;br&gt;
    import { NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs";&lt;br&gt;
    import * as lambda from "aws-cdk-lib/aws-lambda";&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Standardstackdefinition
export class StackSetTemplate extends servicecatalog.ProductStack {
// export class CdkStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props: cdk.StackProps) {
    super(scope, id, props);

    /**
     * Dummy Node JS Lambda Function
     */
      const lambdaFunction = new NodejsFunction(this, "testFunction", {
        memorySize: 128,
        timeout: cdk.Duration.seconds(60),
        runtime: lambda.Runtime.NODEJS_18_X,
        handler: "handler",
        entry: path.join(__dirname, "lambda/index.ts"),
        bundling: {
          minify: true,
          externalModules: ["aws-sdk"]
        }
      });
      lambdaFunction.applyRemovalPolicy(cdk.RemovalPolicy.RETAIN);
    }
  }
}`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Example Lambda Code
&lt;/h3&gt;

&lt;p&gt;Create a new directory &lt;strong&gt;&lt;code&gt;lambda&lt;/code&gt;&lt;/strong&gt; in the &lt;strong&gt;&lt;code&gt;lib&lt;/code&gt;&lt;/strong&gt; directory. In the new lambda directory create a new file called &lt;strong&gt;&lt;code&gt;index.ts&lt;/code&gt;&lt;/strong&gt; and add the following code:&lt;/p&gt;

&lt;p&gt;`    import { Handler } from 'aws-lambda';&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const handler: Handler = async (event, context) =&amp;gt; {
    console.log('EVENT: \n' + JSON.stringify(event, null, 2));
    return context.logStreamName;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;`&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy the StackSet
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;cdk deploy&lt;/code&gt;&lt;br&gt;&lt;br&gt;
in a terminal to deploy the StackSet and associated CloudFormation stacks.&lt;/p&gt;

&lt;p&gt;ℹ️ CDK will ask you to confirm that you want to deploy the changes. Type &lt;strong&gt;y&lt;/strong&gt; and press Enter to continue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this blog post, we've explored how to create a StackSet using AWS CDK. We also learned how to share the CDK Assets to the whole AWS Organization. StackSets are an essential tool for managing infrastructure at scale across multiple AWS accounts and regions. Using CDK, you can easily define and deploy complex cloud infrastructure as code, and leverage the full power of AWS CloudFormation to ensure consistency, compliance, and efficiency across your organisation's cloud resources.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>cloudops</category>
      <category>cdk</category>
    </item>
    <item>
      <title>Enterprise-scaled Self-Healing StackSets</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Thu, 06 Jul 2023 11:55:29 +0000</pubDate>
      <link>https://community.ops.io/daknhh/enterprise-scaled-self-healing-stacksets-3e8f</link>
      <guid>https://community.ops.io/daknhh/enterprise-scaled-self-healing-stacksets-3e8f</guid>
      <description>&lt;p&gt;With more than 5 million articles from over 7,000 brands, OTTO is one of the leading German online shopping platforms. In the future, it will open up to even more brands and partners as part of its transformation. OTTO is part of the internationally active Otto Group, with headquarters in Hamburg, and employs 6,100 people throughout Germany. In the 2020/21 financial year, OTTO generated revenues of 4.5 billion euros.&lt;/p&gt;

&lt;p&gt;At OTTO, we faced several challenges to operate &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html"&gt;AWS CloudFormation StackSets&lt;/a&gt; at Scale. We must govern several hundred AWS accounts for our product teams, all while balancing the need for agility and control.&lt;/p&gt;

&lt;p&gt;At this scale, operations can take a lot of time, because there are multiple operational tasks that we need to do when AWS accounts are leaving the &lt;a href="https://aws.amazon.com/organizations/"&gt;AWS Organization&lt;/a&gt; or Teams are &lt;a href="https://github.com/rebuy-de/aws-nuke"&gt;nuking&lt;/a&gt; the AWS account, StackSets Instances get drifted, because not all required resources for compliance can be secured ( &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/organization-scp-size/#:~:text=The%20maximum%20size%20for%20SCPs,root%2C%20or%20account%20is%20five."&gt;SCP Limitations&lt;/a&gt; ), existing AWS accounts are joining the AWS Organization and all mandatory StackSets needs to be deployed, and manual steps should be reduced to a minimum. Furthermore, there is no feature from the Service itself to gain an overview of the status of drifted Instances and the general health of your StackSet health and compliance.&lt;/p&gt;

&lt;p&gt;The cloud competence center at OTTO IT, also known as the Governance at Scale (GAS) team, developed a solution for self-healing on StackSets, that is integrated into the OTTO tooling ecosystem with Confluence and Microsoft Teams.&lt;/p&gt;

&lt;p&gt;OTTO worked with globaldatanet to set up its Landing Zone. &lt;a href="https://globaldatanet.com/"&gt;globaldatanet&lt;/a&gt; is an award-winning AWS Advanced Consulting Partner and longtime Cloud Solution Provider for OTTO, supporting the team in cloud security and GAS. Their focus on building cloud-native solutions using Serverless supported over 100 companies within 5 years to develop and innovate products and services in the cloud.&lt;/p&gt;

&lt;p&gt;In this post, we’ll demonstrate how to implement fully automated enterprise-scaled self-healing on StackSets using AWS StepFunctions and create a Dashboard to get an overview of your StackSet health and compliance and reduce operational time.&lt;/p&gt;

&lt;p&gt;The solution workflow includes the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; The tagging concept for StackSets&lt;/li&gt;
&lt;li&gt; Automatically create StackSets configuration in SSM Parameter Store&lt;/li&gt;
&lt;li&gt; Implementing StepFunction for StackSet Self-Healing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s see how this works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;The following prerequisites are necessary for following along with the contents of this post:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account"&gt;Two existing AWS Accounts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Few AWS StackSets&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Solution overview
&lt;/h2&gt;

&lt;p&gt;The following architecture shows the whole solution of the Self Healing StackSets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/_WIwoW6VRPzEia0uRHTfPIG2FckixqI7-NXev8eioDA/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/L21vYmlsZS83M2Fk/MmMwMzkyZGM0ZjYy/ZmZmOWQ1ZmJlMzA2/MGU2YTBkZjdmZjNi/LTE0NTl4NTYxLndl/YnA" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/_WIwoW6VRPzEia0uRHTfPIG2FckixqI7-NXev8eioDA/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/L21vYmlsZS83M2Fk/MmMwMzkyZGM0ZjYy/ZmZmOWQ1ZmJlMzA2/MGU2YTBkZjdmZjNi/LTE0NTl4NTYxLndl/YnA" alt="Blog Content" width="800" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Architecture of fully-automated Self Healing Solution with integration to Confluence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tagging concept for StackSets
&lt;/h3&gt;

&lt;p&gt;The solution requires a JSON file in the AWS parameter store, the easiest way is to create it automatically based on the StackSet configurations and the tags assigned there. We'll go into more detail about this in the next section of the Automatically create StackSets configuration Parameter Store article. In the following, we describe which tags we introduced to our StackSet and what we need these tags for.&lt;/p&gt;

&lt;p&gt;⚠️ AWS tags do not allow commas in value, so ":" as divider for arrays&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;antidependson&lt;/td&gt;
&lt;td&gt;StackSet Name&lt;/td&gt;
&lt;td&gt;antidependson marks stacksets which collide with each other.&lt;/td&gt;
&lt;td&gt;MYSTACKSET&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;dependson&lt;/td&gt;
&lt;td&gt;[List of StackSet Names]&lt;/td&gt;
&lt;td&gt;List of Stacksets that need to be rolled out before deploying this stackset (e.g. Enable Config before Activate Config Rules). NOTE : Please reduce to only one dependson-stackset for now. Form "chains" for multi-dependencies.&lt;/td&gt;
&lt;td&gt;MY-STACKSET1:MYSTACKSET2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mandatory&lt;/td&gt;
&lt;td&gt;true or false&lt;/td&gt;
&lt;td&gt;The stackset instances must be present on all AWS accounts&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;selfhealing&lt;/td&gt;
&lt;td&gt;true or false&lt;/td&gt;
&lt;td&gt;StackSet can be healed via Delete &amp;amp; Redeploy (exception e.g. IDP roles) - Parameter Overwrites will be cached.&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;region&lt;/td&gt;
&lt;td&gt;[Regions]&lt;/td&gt;
&lt;td&gt;List of Regions in which the stackset instances are to be deployed&lt;/td&gt;
&lt;td&gt;eu-west-1:eu-central-1:us-east-1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Automatically create StackSets configuration Parameter Store
&lt;/h3&gt;

&lt;p&gt;The automated generation of the Stackset-configuration via JSON inside the ParameterStore is a multi-purpose-utility:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Removing the chore to configure manually a JSON-document&lt;/li&gt;
&lt;li&gt; Ensure the Account vending-machines knows what to deploy in which order&lt;/li&gt;
&lt;li&gt; Supporting the self-healing StepFunction about the expected setup of the member-accounts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Lambda responsible for the task is invoked via a Events-Rule:&lt;br&gt;&lt;br&gt;
Every time a Stackset-Operation has been finished with status "succeeded".&lt;br&gt;&lt;br&gt;
This is due the tags on a Stackset are part of the stackset, not Additional items describing a Stackset, therefore a change to the tags always will result in a Stackset-Update-operation.  &lt;/p&gt;

&lt;p&gt;In terms of computerscience the Lambda is quite interesting, as the primary problem was to build a nonweighted tree based on the "dependson" and "antidependson" tags and then compile an ordered one-dimensional list, like in the good old "travelling salesmen"-problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Implementing StepFunction for StackSet Self-Healing
&lt;/h3&gt;

&lt;p&gt;AWS Step Functions is a cloud service that enables you to coordinate the components of distributed applications and microservices using visual workflows. It allows you to build and automate the execution of complex processes and tasks across multiple AWS services, using a visual interface to define and execute your workflows. Since the Self Healing Solutions needs a complex workflow we decided to use Step Functions for this Usecase. Following we will explain you the workflow of the Self Healing.&lt;/p&gt;

&lt;h4&gt;
  
  
  StepFunction Workflow
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/y2GFRM_lyQYCxkggOeGhp6Fm7wOV1l27LC_aIAZUE1w/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/L21vYmlsZS9hNzAx/NzEyZDUxOTQ5NDk2/MzMxZTMyODI4NzI0/ZWNmNmVmNjczNDQ4/LTg3N3gxMDc0Lndl/YnA" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/y2GFRM_lyQYCxkggOeGhp6Fm7wOV1l27LC_aIAZUE1w/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/L21vYmlsZS9hNzAx/NzEyZDUxOTQ5NDk2/MzMxZTMyODI4NzI0/ZWNmNmVmNjczNDQ4/LTg3N3gxMDc0Lndl/YnA" alt="Blog Content" width="800" height="980"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Functionality
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;ƛ Serverless Functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;StackSetInitCleanupLambda&lt;/strong&gt;: Performs a search to identify StackSet instances of AWS Accounts that are either not present within the AWS Organization or deployed to AWS accounts that are suspended. Once identified, proceed with the deletion of these instances from all associated StackSets.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;MandatoryStackSetDeploymentLambda&lt;/strong&gt;: Search missing StackSets Instances (which are tagged with mandatory = true) and deploy those Instances&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;StackSetDriftDetectionLambda&lt;/strong&gt;: Trigger &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DetectStackDrift.html"&gt;Drift Detection&lt;/a&gt; on all StackSets&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;TriggerDriftStatusLambda&lt;/strong&gt;: Check if Drift Detection is completed on all StackSets&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;SearchStackSetInstanceToHealLambda&lt;/strong&gt;: Searches for drifted StackSet Instances from StackSets which are tagged with &lt;strong&gt;Selfhealing = true&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;StackSetCleanupLambda&lt;/strong&gt;: Removes unhealthy StackSet Instances and redeploys them. Parameter Overrides will be cached so the new deployed instance will have the same setting as before.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;StatusPrepareHTMLLambda&lt;/strong&gt;: Prepare the HTML output Dashboard for Confluence and Json log file of the current StackSet Healthiness State&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;TeamsNotificationLambda&lt;/strong&gt;: Send Teams Notification which summary to notify the GAS Team after each execution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;？！Decisions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;InitCleanup Complete:&lt;/strong&gt; Check whether all unnecessary instances have been removed. If not, StepFunction is triggering the &lt;strong&gt;StackSetInitCleanupLambda&lt;/strong&gt; function again.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;MandatoryStackSetDeployment Complete&lt;/strong&gt;: Checks whether all mandatory instances have been deployed. If not, StepFunction is triggering the &lt;strong&gt;MandatoryStackSetDeploymentLambda&lt;/strong&gt; function again.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;StackSetDriftDetection Complete:&lt;/strong&gt; Wait until StackSet Drift Detection has been finished on all StackSets&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Healing Complete:&lt;/strong&gt; Check if all unhealthy Instances are healed otherwise invoke &lt;strong&gt;StackSetCleanupLambda&lt;/strong&gt; again&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;While developing the solution we faced several limitations. Here are our findings and solutions for that.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html"&gt;🚨 StackSets instance operations&lt;/a&gt;:&lt;/strong&gt; Maximum number of stack instances, across all stack sets, that you can run operations on in each Region at the same time, per administrator account is limited to 10.000 operations.  &lt;/p&gt;

&lt;p&gt;✅ We implemented a counter to count the current StackSets operations which are in progress, in addition we also catching the Exception from CloudFormation and waiting few seconds to try the operation again.  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;🚨 Parameter Overwrites Caching:&lt;/strong&gt; Whenever removing a drifted StackSet Instance which has Parameter Overwrite you will lose the individually parameters of the Instance.  &lt;/p&gt;

&lt;p&gt;✅ Before deleting the drifted StackSet Instance we cache the Parameter Overwrites and deploy the StackSet Instance after successful deletion again with the cached Parameter Overwrites again.  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2020/09/aws-step-functions-increases-payload-size-to-256kb/"&gt;🚨AWS Step Functions Payload size:&lt;/a&gt;&lt;/strong&gt; AWS Step Functions supports payload sizes up to 256KB. For our solution we need more Payloads between the States especially when we want to pass our log or the concurrent Parameter Overwrites per StackSet.  &lt;/p&gt;

&lt;p&gt;✅ We are storing our states in an S3 bucket to pass the state. At the end of the execution we are deleting the state from S3 to not to influence the next Step Function execution with the wrong state.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Documentation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After each execution of the StackSet Health StepFunction, we aim to notify our GAS team about the actions taken during the previous run. Therefore, we have implemented a Teams notification that includes a status update, a link to the generated dashboard, and a link to the log file.&lt;/p&gt;

&lt;p&gt;The following screenshot illustrates an example of a Teams notification. It provides a summary report and directs you to the dashboard and log file for further details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/i2_57KRgrRnOEIRuDzGfkWCLDbM5D18JRC7z3KG52KM/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/L21vYmlsZS85ZmM3/ZjZhMzM3ZTM0ZDY3/ODVmOGE1MTFiNTcx/NDNkNGZlNjhmMTdm/LTYwOXgzODcud2Vi/cA" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/i2_57KRgrRnOEIRuDzGfkWCLDbM5D18JRC7z3KG52KM/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/L21vYmlsZS85ZmM3/ZjZhMzM3ZTM0ZDY3/ODVmOGE1MTFiNTcx/NDNkNGZlNjhmMTdm/LTYwOXgzODcud2Vi/cA" alt="Blog Content" width="609" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Dashboard
&lt;/h3&gt;

&lt;p&gt;Our StackSet Health Dashboard is a simple HTML file which will be generated trough a Lambda Function, saved in S3 and will be distributed trough a CloudFrount. You can integrate this Dashboards in your Confluence or any other internal Wiki. This Dashboard is secured via CloudFormation Function - additionally you can also add a &lt;a href="https://globaldatanet.com/solutions/web-application-firewalls-at-scale"&gt;Firewall&lt;/a&gt; to restrict the access to an specific CIDR or Geographic region and prevent access from third parties. The screenshot below provides an example of the overall StackSet Health status information for an entire AWS Organization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/k1No1b8oxPJ3M8sw1yXyqUBaqBkiiczGwqwBOyaJ3o4/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/L21vYmlsZS9jZmU5/ZDU2YWQzZGMxNTk2/ZGM1YmJkNzQzZGZm/M2Y1MDJlZTRjOGI2/LTEzNzZ4NDk5Lndl/YnA" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/k1No1b8oxPJ3M8sw1yXyqUBaqBkiiczGwqwBOyaJ3o4/w:800/mb:500000/ar:1/aHR0cHM6Ly9nbG9i/YWxkYXRhbmV0LmNv/bS9pbWFnZXMvY21z/L21vYmlsZS9jZmU5/ZDU2YWQzZGMxNTk2/ZGM1YmJkNzQzZGZm/M2Y1MDJlZTRjOGI2/LTEzNzZ4NDk5Lndl/YnA" alt="Blog Content" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this post, we demonstrated a solution to automatically heal AWS CloudFormation StackSets at scale. By implementing this Solution Organisations we reduced manual effort for StackSet cleanup operations by 4 hours per week, improved the overall reliability of our StackSets, increased our compliance in the organisation, and managed to get a daily updated overview for all StackSet Instances using the dashboards. In summary, the self-healing CloudFormation StackSets solution combines automation, monitoring, and self-recovery capabilities to deliver a robust and resilient system for StackSets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/NLhCm268aareNfw1JDfoYPLYskYe0Hfy-JZ_dHM_JEk/w:800/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMveGcz/emF6ZmM4bmE0NWMw/OHRoMjcuanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/NLhCm268aareNfw1JDfoYPLYskYe0Hfy-JZ_dHM_JEk/w:800/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMveGcz/emF6ZmM4bmE0NWMw/OHRoMjcuanBn" alt="Image description" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>security</category>
    </item>
    <item>
      <title>AWS Landing Zone versus AWS Control Tower</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:40:26 +0000</pubDate>
      <link>https://community.ops.io/daknhh/aws-landing-zone-versus-aws-control-tower-ld1</link>
      <guid>https://community.ops.io/daknhh/aws-landing-zone-versus-aws-control-tower-ld1</guid>
      <description>&lt;p&gt;What is the difference between AWS Landing Zones and AWS Control Tower? Customised Solution or Managed Service?!&lt;/p&gt;

&lt;p&gt;AWS Landing Zone and AWS Control Tower help set up and govern a new, secure, multi-account AWS environment based on AWS best practices. Both consist of core accounts and resources which will implement a initial security baseline. &lt;br&gt;
The following table compares the managed service (AWS Control Tower) with the solution (AWS Landing Zone).&lt;/p&gt;

&lt;h4&gt;
  
  
  Update:
&lt;/h4&gt;

&lt;p&gt;🚨 AWS Control Tower allows existing organizations to set up a landing zone. &lt;/p&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;&lt;img src="https://community.ops.io/images/eXMekpsACyb0d6W05k7cnGlhaLCFTaBhMRHlLd55pJQ/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvNDlkaHFl/ZzhzYWpiMjg1NzZy/d2oucG5n" alt="AWS LandingZone" width="75" height="74"&gt;&lt;/th&gt;
&lt;th&gt;&lt;img src="https://community.ops.io/images/nShcGlWllmTOIGpQ5mcHtbMYbNlPhbFXx2bkuVTC1VQ/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvajh1cWYz/ZjQ5NXVrZjVsZDQx/YzIucG5n" alt="AWS Control Tower" width="75" height="75"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Delivery mechanism&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://s3.amazonaws.com/solutions-reference/aws-landing-zone/latest/aws-landing-zone-initiation.template"&gt;CloudFormation&lt;/a&gt; or &lt;a href="https://registry.terraform.io/modules/MitocGroup/landing-zone/aws/0.2.4"&gt;Terraform&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;AWS managed service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Architectural support&lt;/td&gt;
&lt;td&gt;Fully customizable and owned by customer&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://aws.amazon.com/de/solutions/customizations-for-aws-control-tower/"&gt;Customizable via Solution&lt;/a&gt; + AWS recommend best practices with managed blueprints and guardrails&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Account structure&lt;/td&gt;
&lt;td&gt;Complete flexibility for customer-defined account structure &lt;img src="https://community.ops.io/images/HNjGQgSjHGWGLueHJmDZieON0xko0CAAxMWm3yVJ1J0/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvODdkcWFx/amFjNDRyc2NmMHls/eWgucG5n" alt="AWS LandingZone Architecture" width="657" height="744"&gt;
&lt;/td&gt;
&lt;td&gt;Two non-configurable core accounts, no SS, no Amazon VPC in core &lt;img src="https://community.ops.io/images/SZHY0BxGJlzCB2NFt4DUpjKo6EAFDmMMD90h_Hxcylc/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvcXFyMTZl/Mm9keXlodmxuY2xi/Z2IucG5n" alt="AWS ControlTower Architecture" width="764" height="641"&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Federated access&lt;/td&gt;
&lt;td&gt;AWS SSO, AWS-Managed Microsoft AD or Active Directory Connector&lt;/td&gt;
&lt;td&gt;Preconfigured with AWS SSO (AD or SSO Directory?) and integrated with third-party SSO providers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operations&lt;/td&gt;
&lt;td&gt;Extensible capabilities to manage the most complex and advanced environments&lt;/td&gt;
&lt;td&gt;Simple setup and management for reduced operational overhead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automated account creation&lt;/td&gt;
&lt;td&gt;✅ &lt;a href="https://github.com/aws-samples/aws-account-vending-machine"&gt;Account Vending Machine&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Member account region support (VPC)&lt;/td&gt;
&lt;td&gt;✅ All regions are supported&lt;sup id="fnref1"&gt;1&lt;/sup&gt;
&lt;/td&gt;
&lt;td&gt;➖  &lt;strong&gt;North-Virginia&lt;/strong&gt; (us-east-1), &lt;strong&gt;Ohio&lt;/strong&gt; (us-east-2),   &lt;strong&gt;Oregon&lt;/strong&gt; (us-west-2), &lt;strong&gt;Irland&lt;/strong&gt; (eu-west-1),  &lt;strong&gt;Sydney&lt;/strong&gt; (ap-southeast-2) &lt;sup id="fnref2"&gt;2&lt;/sup&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;General region support&lt;/td&gt;
&lt;td&gt;✅ All regions are supported&lt;/td&gt;
&lt;td&gt;➖  &lt;strong&gt;North-Virginia&lt;/strong&gt; (us-east-1), &lt;strong&gt;Ohio&lt;/strong&gt; (us-east-2),   &lt;strong&gt;Oregon&lt;/strong&gt; (us-west-2), &lt;strong&gt;Irland&lt;/strong&gt; (eu-west-1),  &lt;strong&gt;Sydney&lt;/strong&gt; (ap-southeast-2)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use existing AWS Organization&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use existing SSO environment&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use existing AWS Service Catalog environment&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New or Existing Security Hub environment&lt;/td&gt;
&lt;td&gt;✅ &lt;a href="https://github.com/awslabs/aws-securityhub-multiaccount-scripts"&gt;Multiaccount Scripts&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;h4&gt;
  
  
  AWS Landing Zone
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.awslandingzone.com/guides/aws-landing-zone-implementation-guide.pdf"&gt;📚 Implementation Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.awslandingzone.com/guides/aws-landing-zone-developer-guide.pdf"&gt;📚 Developers Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.awslandingzone.com/guides/aws-landing-zone-user-guide.pdf"&gt;📚 User Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.awslandingzone.com/guides/aws-landing-zone-upgrade-guide.pdf"&gt;📚 Upgrade Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/user/AmazonWebServices/search?query=aws+landing+zone"&gt;📺 Videos&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🧰 &lt;strong&gt;Solutions&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;- &lt;a href="https://github.com/aws-samples/aws-account-vending-machine"&gt;🔧 Account Vending Machine&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;- &lt;a href="https://github.com/awslabs/aws-securityhub-multiaccount-scripts"&gt;🔧 Security Hub Multiaccount Scripts&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  AWS Control Tower
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/controltower/latest/userguide/controltower-ug.pdf"&gt;📚 User Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/de/controltower/pricing/"&gt;📚 Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://controltower.aws-management.tools/"&gt;🎓 Labs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/user/AmazonWebServices/search?query=aws+control+tower"&gt;📺 Videos&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🧰 &lt;strong&gt;Solutions&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;- &lt;a href="https://aws.amazon.com/de/solutions/customizations-for-aws-control-tower/"&gt;🔧 Customizations for AWS Control Tower&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;- &lt;a href="https://aws.amazon.com/de/blogs/field-notes/enabling-guardrails-in-new-aws-regions-the-aws-control-tower-supports/"&gt;🔧 Enabling guardrails in new AWS Regions the AWS Control Tower supports&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Which one should I choose?
&lt;/h3&gt;

&lt;p&gt;❓Are you new two AWS? &lt;br&gt;
❗️Use &lt;strong&gt;AWS Control Tower&lt;/strong&gt; &lt;br&gt;
❓Do you need a configurable landing zone with full customization and control over every part? &lt;br&gt;
❗️Use &lt;strong&gt;AWS Landing Zone&lt;/strong&gt;&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;Member accounts could be provisioned in every region no matter where the Account Vending Machine is deployed.  ⚠️You just need to take care that your CloudFormation templates &amp;amp; Lambdas are available in the requested region.  ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;AWS Control Tower could provision new Accounts (Network baseline) into the following regions: &lt;strong&gt;North-Virginia&lt;/strong&gt; (us-east-1), &lt;strong&gt;Ohio&lt;/strong&gt; (us-east-2), &lt;strong&gt;Oregon&lt;/strong&gt; (us-west-2), &lt;strong&gt;Irland&lt;/strong&gt; (eu-west-1) and &lt;strong&gt;Sydney&lt;/strong&gt; (ap-southeast-2). ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>governance</category>
      <category>secops</category>
    </item>
    <item>
      <title>Encryption of SSM session data using KMS</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:39:47 +0000</pubDate>
      <link>https://community.ops.io/daknhh/encryption-of-ssm-session-data-using-kms-3dfl</link>
      <guid>https://community.ops.io/daknhh/encryption-of-ssm-session-data-using-kms-3dfl</guid>
      <description>&lt;p&gt;&lt;a href="https://community.ops.io/images/xFrP0YA61i7fx2Q1t6IjzTmvquCgfJWrLjG8cgoeEJg/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvaGRz/bGFobzFvcmV1NWNu/djMyZmgucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/xFrP0YA61i7fx2Q1t6IjzTmvquCgfJWrLjG8cgoeEJg/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvaGRz/bGFobzFvcmV1NWNu/djMyZmgucG5n" alt="" width="880" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Connecting to your EC2 Instances using Session Manager is for years already a default. However most of the users are just using the defaultTLS 1.2 encryption that AWS already provides by default. For most of the usecases this is ok, but sometimes it is required to encrypt your sessions with your own KMS Keys. Encrypting session data with your key also enables sessions to handle confidential data interactions, such as password resets, and further improves your security posture when using Systems Manager Session Manager. To use the option to encrypt session data using a key created in AWS KMS, version 2.3.539.0 or later AWS Systems Manager SSM Agent must be installed on the managed instance.&lt;/p&gt;

&lt;p&gt;In addition i would also recommend to log the session data either to S3 or to CloudWatch and to encrypt the session data which is logged to the destination using your own KMS Key. In the following post I will explain how to automatically configure the SSM default settings to secure your session data using your own KMS key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/CyluRC1t75fFod4NYjQprvtDXt2TfXZ4-ia0NY8mCQM/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvcWps/NXU2aW5oajBnbW9s/cXV0ZXgucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/CyluRC1t75fFod4NYjQprvtDXt2TfXZ4-ia0NY8mCQM/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvcWps/NXU2aW5oajBnbW9s/cXV0ZXgucG5n" alt="Architecture" width="880" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Set up the required KMS Keys using this &lt;a href="https://gist.github.com/daknhh/532b542d650e0eebbe1f3f95bd3a4cff"&gt;template&lt;/a&gt; using StackSet or Stack - this template will create the needed KMS Keys for SSM and CloudWatch with permissions.&lt;/li&gt;
&lt;li&gt;Create a LambdaLayer with &lt;code&gt;boto3&lt;/code&gt; or use a &lt;a href="https://github.com/keithrozario/Klayers"&gt;prebuild layer.&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Deploy the following &lt;a href="https://gist.github.com/daknhh/031fa70fa4c7ccd3410ed12add3511ef"&gt;template&lt;/a&gt; using StackSet or Stack - the template which I provided will configure your Session Manager. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After successfull deployment:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/4ig7Y4WW87Q1aqrDBoAc4gOlsaxvXtbOmxdbRFfkONE/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvcnF2/MmVncWc5NzN0bHU2/Y3BwbTguanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/4ig7Y4WW87Q1aqrDBoAc4gOlsaxvXtbOmxdbRFfkONE/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvcnF2/MmVncWc5NzN0bHU2/Y3BwbTguanBn" alt="Session Manager Settings" width="880" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Optionally secure CloudWatch LogGroup using SCPs.
Since the CloudWatch LogGroup from Session Manager will contain sensitve data, I would recommend to secure the LogGroup using SCPs so that only a few people from your audit team can read them.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"CloudWatchLogsDeny"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Deny"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"logs:DescribeLogStreams"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:logs:*:*:log-group:/aws/ssm/SessionManagerLogGroup:*"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Condition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"ArnNotLike"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"aws:PrincipalArn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:iam::*:role/AuditRole"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;Now you can either use your browser or CLI to connect to your instance using the Session Manager and during the session all data will be encrypted using your own KMS Key. &lt;/p&gt;

&lt;p&gt;ℹ️ You can not use &lt;code&gt;aws ssm start-session&lt;/code&gt; with the &lt;code&gt;--profile&lt;/code&gt; flag that needs a MFA because there is an &lt;a href="https://github.com/aws/aws-cli/issues/6218"&gt;🚨 issue&lt;/a&gt; right now that the command doens't ask for MFA. &lt;/p&gt;

&lt;p&gt;Workaround: Using &lt;a href="https://awsu.me/"&gt;awsume&lt;/a&gt; solves this problem.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>kms</category>
      <category>ssm</category>
    </item>
    <item>
      <title>CloudFront Functions</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:39:12 +0000</pubDate>
      <link>https://community.ops.io/daknhh/cloudfront-functions-3gi9</link>
      <guid>https://community.ops.io/daknhh/cloudfront-functions-3gi9</guid>
      <description>&lt;p&gt;&lt;a href="https://community.ops.io/images/DQX3STjox3tOABHytYR7jtPaAtFZaSgyZ2MF6WJ2GRA/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvNzY4/MHVpNHg4OXhrM3Yx/Z2cyYWsucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/DQX3STjox3tOABHytYR7jtPaAtFZaSgyZ2MF6WJ2GRA/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvNzY4/MHVpNHg4OXhrM3Yx/Z2cyYWsucG5n" alt="CloudFront Functions" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;A few weeks ago Amazon announced a &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/05/cloudfront-functions/"&gt;new feature&lt;/a&gt; for Amazon CloudFront to run code in Edge Locations. But where is the difference between Lambda@Edge and CloudFront Functions?&lt;br&gt;
CloudFront Functions are running in Edge locations whereas Lambda@Edge functions are executed in a regional edge cache (eg.: the AWS region closest to the CloudFront edge location reached by the client). Therefore CloudFront Functions are even closer to the client and are at the same time approximately 1/6th the price of Lambda@Edge.&lt;/p&gt;
&lt;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Authorization&lt;/strong&gt;: Implement authorization for the content delivered through CloudFront using Basic Authentication or by creating and validating user-generated tokens. &lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Redirects&lt;/strong&gt;: Redirect users to a different URL - eg.: If you change to a new website structure you can redirect the user to the new URL.&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Header Manipulation&lt;/strong&gt;: Add, modify, or delete any of the request/response headers - eg.: foward the IP of the client using the Header to your origin.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  CloudFront Functions versus Lambda@Edge
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;p&gt;Most important differences - if you need more information check this docs: &lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions.html"&gt;Choosing between CloudFront Functions and Lambda@Edge&lt;/a&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;CloudFront Functions&lt;/th&gt;
&lt;th&gt;Lambda@Edge&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Execution location&lt;/td&gt;
&lt;td&gt;CloudFront Edge Locations&lt;/td&gt;
&lt;td&gt;CloudFront Regional Edge Caches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Programming languages&lt;/td&gt;
&lt;td&gt;JavaScript (&lt;a href="https://262.ecma-international.org/5.1/"&gt;ECMAScript 5.1&lt;/a&gt; compliant)&lt;/td&gt;
&lt;td&gt;Python, Nodejs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Event sources&lt;/td&gt;
&lt;td&gt;Viewer request  Viewer response&lt;/td&gt;
&lt;td&gt;Viewer request  Viewer response Origin request  Origin response&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory&lt;/td&gt;
&lt;td&gt;2 MB&lt;/td&gt;
&lt;td&gt;128 MB (viewer triggers) – 10 GB (origin triggers)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Max size of Function&lt;/td&gt;
&lt;td&gt;10 KB&lt;/td&gt;
&lt;td&gt;1 MB (viewer request / response)  50 MB (origin request / response)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Max execution time&lt;/td&gt;
&lt;td&gt;1 ms&lt;/td&gt;
&lt;td&gt;5 seconds (viewer request / response)  30 seconds (origin request / response)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access to geolocation and device data&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌ (viewer request)  ✅ (viewer response)  ✅ (origin request)   ✅ (origin response)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access to the request body&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Pricing example
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;th&gt;Price per Invocation&lt;/th&gt;
&lt;th&gt;Price per Duration (for every GB-second)&lt;/th&gt;
&lt;th&gt;Invocations&lt;/th&gt;
&lt;th&gt;Duration&lt;/th&gt;
&lt;th&gt;Allocated Memory&lt;/th&gt;
&lt;th&gt;Total Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CloudFront Function&lt;/td&gt;
&lt;td&gt;$0.1&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;2 Million&lt;/td&gt;
&lt;td&gt;1ms&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;$2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lambda@Edge&lt;/td&gt;
&lt;td&gt;$0.6&lt;/td&gt;
&lt;td&gt;$0,00005001&lt;/td&gt;
&lt;td&gt;2 Million&lt;/td&gt;
&lt;td&gt;10ms&lt;/td&gt;
&lt;td&gt;128MB&lt;/td&gt;
&lt;td&gt;$12.26&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;The prices were checked on 30.05.2021 from &lt;a href="https://aws.amazon.com/lambda/pricing/"&gt;Lambda@Edge pricing&lt;/a&gt; and &lt;a href="https://aws.amazon.com/cloudfront/pricing/"&gt;CloudFront Function pricing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Example template for Basic Auth with CloudFront Functions
&lt;/h2&gt;

&lt;p&gt;Following you will find a CloudFront Function for Basic Auth - I am using it as a second layer of security for private CloudFront origins. For example I am generating exports of Jira content to S3 using a Lambda as a Backup. In Front of CloudFront I have a WAF to restrict to spefic IPs plus these CloudFront functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;AWSTemplateFormatVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;2010-09-09&lt;/span&gt;
&lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Creates a Base CloudFront Function for Authentification&lt;/span&gt;
&lt;span class="na"&gt;Metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Author&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;David Krohn&lt;/span&gt;

&lt;span class="na"&gt;Parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;CloudFrountUsername&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Username CloudFront&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
  &lt;span class="na"&gt;CloudFrountPassword&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Password CloudFront&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;NoEcho&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;Ressources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;CloudFrontFunctionBasicAuth&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::CloudFront::Function&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
      &lt;span class="na"&gt;AutoPublish&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;FunctionCode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;var USERS = {&lt;/span&gt;
            &lt;span class="s"&gt;Website: [{&lt;/span&gt;
                &lt;span class="s"&gt;username: '${CloudFrountUsername}',&lt;/span&gt;
                &lt;span class="s"&gt;password: '${CloudFrountPassword}',&lt;/span&gt;
            &lt;span class="s"&gt;}],&lt;/span&gt;
        &lt;span class="s"&gt;};&lt;/span&gt;

        &lt;span class="s"&gt;//Response when auth is not valid.&lt;/span&gt;
        &lt;span class="s"&gt;var response401 = { &lt;/span&gt;
            &lt;span class="s"&gt;statusCode: 401,&lt;/span&gt;
            &lt;span class="s"&gt;statusDescription: 'Unauthorized',&lt;/span&gt;
            &lt;span class="s"&gt;headers: {&lt;/span&gt;
                &lt;span class="s"&gt;'www-authenticate': {&lt;/span&gt;
                    &lt;span class="s"&gt;value: 'Basic'&lt;/span&gt;
                &lt;span class="s"&gt;},&lt;/span&gt;
            &lt;span class="s"&gt;},&lt;/span&gt;
        &lt;span class="s"&gt;};&lt;/span&gt;

        &lt;span class="s"&gt;var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";&lt;/span&gt;

        &lt;span class="s"&gt;function btoa(input) {&lt;/span&gt;
            &lt;span class="s"&gt;input = String(input);&lt;/span&gt;
            &lt;span class="s"&gt;var bitmap, a, b, c,&lt;/span&gt;
                &lt;span class="s"&gt;result = "",&lt;/span&gt;
                &lt;span class="s"&gt;i = 0,&lt;/span&gt;
                &lt;span class="s"&gt;rest = input.length % 3; // To determine the final padding&lt;/span&gt;

            &lt;span class="s"&gt;for (; i &amp;lt; input.length;) {&lt;/span&gt;
                &lt;span class="s"&gt;if ((a = input.charCodeAt(i++)) &amp;gt; 255 ||&lt;/span&gt;
                    &lt;span class="s"&gt;(b = input.charCodeAt(i++)) &amp;gt; 255 ||&lt;/span&gt;
                    &lt;span class="s"&gt;(c = input.charCodeAt(i++)) &amp;gt; 255)&lt;/span&gt;
                    &lt;span class="s"&gt;throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");&lt;/span&gt;

                &lt;span class="s"&gt;bitmap = (a &amp;lt;&amp;lt; 16) | (b &amp;lt;&amp;lt; 8) | c;&lt;/span&gt;
                &lt;span class="s"&gt;result += b64.charAt(bitmap &amp;gt;&amp;gt; 18 &amp;amp; 63) + b64.charAt(bitmap &amp;gt;&amp;gt; 12 &amp;amp; 63) +&lt;/span&gt;
                    &lt;span class="s"&gt;b64.charAt(bitmap &amp;gt;&amp;gt; 6 &amp;amp; 63) + b64.charAt(bitmap &amp;amp; 63);&lt;/span&gt;
            &lt;span class="s"&gt;}&lt;/span&gt;

            &lt;span class="s"&gt;// If there's need of padding, replace the last 'A's with equal signs&lt;/span&gt;
            &lt;span class="s"&gt;return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result;&lt;/span&gt;
        &lt;span class="s"&gt;}&lt;/span&gt;

        &lt;span class="s"&gt;function handler(event) {&lt;/span&gt;
            &lt;span class="s"&gt;var request = event.request;&lt;/span&gt;
            &lt;span class="s"&gt;var headers = request.headers;&lt;/span&gt;

            &lt;span class="s"&gt;var auth = request.headers.authorization &amp;amp;&amp;amp; request.headers.authorization.value;&lt;/span&gt;


            &lt;span class="s"&gt;var users = USERS['Website'];&lt;/span&gt;

            &lt;span class="s"&gt;if (users) {&lt;/span&gt;
                &lt;span class="s"&gt;if (!auth || !auth.startsWith('Basic ')) {&lt;/span&gt;
                    &lt;span class="s"&gt;return response401;&lt;/span&gt;
                &lt;span class="s"&gt;}&lt;/span&gt;
                &lt;span class="s"&gt;if(!users.find(function(user) {&lt;/span&gt;

                        &lt;span class="s"&gt;// Construct the Basic Auth string&lt;/span&gt;
                        &lt;span class="s"&gt;var authString = 'Basic ' + btoa(user.username + ':' + user.password);&lt;/span&gt;

                        &lt;span class="s"&gt;return authString === auth;&lt;/span&gt;
                    &lt;span class="s"&gt;})) {&lt;/span&gt;
                    &lt;span class="s"&gt;return response401;&lt;/span&gt;
                &lt;span class="s"&gt;}&lt;/span&gt;
            &lt;span class="s"&gt;}&lt;/span&gt;
            &lt;span class="s"&gt;return request;&lt;/span&gt;
        &lt;span class="s"&gt;}&lt;/span&gt;

      &lt;span class="na"&gt;FunctionConfig&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;Comment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Basic&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Auth&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;for&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;S3&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Bucket&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;${MyWebsiteBucket}'&lt;/span&gt;
        &lt;span class="na"&gt;Runtime&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cloudfront-js-1.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More samples can be found here: &lt;a href="https://github.com/aws-samples/amazon-cloudfront-functions"&gt;Amazon CloudFront Functions Samples&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloudfront</category>
    </item>
    <item>
      <title>One week at globaldatanet as AWS Cloud Engineer - David Edition</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:38:38 +0000</pubDate>
      <link>https://community.ops.io/daknhh/one-week-at-globaldatanet-as-aws-cloud-engineer-david-edition-4c3g</link>
      <guid>https://community.ops.io/daknhh/one-week-at-globaldatanet-as-aws-cloud-engineer-david-edition-4c3g</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hello, I am David 👋🏻&lt;/strong&gt; - Today I'm going to give you an in-depth look at my week as a Senior AWS Cloud Engineer at globaldatanet. Right now I am working on 2 customer projects which means more structuring of my week but also giving me the possibility to work with a diversified range of different tools and tasks. Usually, roughly one day of my week is dedicated to a customer working in the e-commerce industry, the other days are assigned to another customer, a big insurance company. Let’s dive right in! 🤿.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/J1kvNPPGhL3lxtV1DKBv5csN70YqFsmbcv41eZnqFb0/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvcHlx/b2VpcWM1ZWQ0aXZo/ajBjYnoucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/J1kvNPPGhL3lxtV1DKBv5csN70YqFsmbcv41eZnqFb0/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvcHlx/b2VpcWM1ZWQ0aXZo/ajBjYnoucG5n" alt="David - APN Ambassador / AWS Cloud Engineer" width="880" height="928"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My week 🗓
&lt;/h2&gt;

&lt;p&gt;I usually start the day with a cup of coffee. At the same time, I first check Slack and Teams to see what news there has been in the past few days. I also scan Twitter and AWS Blog Post for exciting new features for social media and our customers.&lt;/p&gt;

&lt;h4&gt;
  
  
  Monday
&lt;/h4&gt;

&lt;p&gt;On Mondays, before the day really gets going, I take the time to plan the whole week. That means I first get an overview of the upcoming tasks for this week, which user stories were completed last week and which are coming up this week.&lt;br&gt;
Typically the day starts with a daily team meeting with the customer, in which the tasks for the day are briefly defined, and the previous week is compactly reviewed as well. This Monday I primarily did some troubleshooting for Athena Partitions, fixing the lambda to automatically create new partitions for budget report dashboards every month. For the same customer, I also spend some time building a tool to detect the reason for the cost explosion. For example, showing that one Fargate was corrupted and was starting to create/ delete network interfaces 400 times higher than usual each day. As part of my day, I also worked on a cost optimization task, decoding Alexa Skills mp3s (320kbit to 128kbits) on Amazon S3, as well as adjusting the max-age for S3 objects. As a highlight this Monday we also had a call with AWS directly to present our previously implemented solutions for our current customer and discuss potential new opportunities.&lt;/p&gt;

&lt;h4&gt;
  
  
  Tuesday
&lt;/h4&gt;

&lt;p&gt;Business as usual Tuesday also started with the daily at 9. Followed up by a call with the technical manager to discuss the user stories in more detail. What have I been working on this Tuesday? Mainly doing the automation for the customer internal web application firewall, as well as scanning the whole organization for non-compliant resources, cleaning up &amp;amp; fixing those resources in accordance with Config cleanup rules.&lt;/p&gt;

&lt;h4&gt;
  
  
  Wednesday
&lt;/h4&gt;

&lt;p&gt;As you already know how my day starts I will jump right into my tasks on Wednesday. Besides the Config cleanup rules which I was still working on, I also fixed the automation for ConfigAggregators as the aggregators were not processed properly when moving from one account to another organizational unit. Currently, I am also preparing an AWS blog post, as well as we are discussing further details about the customer internal web application firewall, which means today was more of a mix between working on my customer projects and some planning meetings. Besides that, I also reached out to the diagrams.net developers to get more information on the API for the open-source &lt;a href="https://github.com/daknhh/aws-orgtool"&gt;orgtool&lt;/a&gt; extension.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/SqfdLxp-p9huoAbDofyjPVX5ZvwhcD4X0F6EA7YIzQ4/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvMWxy/YXRicnR6NDhmeDJn/dWxvZjgucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/SqfdLxp-p9huoAbDofyjPVX5ZvwhcD4X0F6EA7YIzQ4/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvMWxy/YXRicnR6NDhmeDJn/dWxvZjgucG5n" alt="ORGTOOL diagrams.net output" width="800" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Thursday
&lt;/h4&gt;

&lt;p&gt;On Thursday I was mainly creating a tool to automatically create IAM users, tags, and groups to JSON and CSV. Additionally, I also added a feature in the internal cost detection explosion tool to export CSV files. To make sure previously encountered issues can be overcome with ease in the future, I also created a Cleanup/ Closing Account Runbook for the customer.&lt;/p&gt;

&lt;h4&gt;
  
  
  Friday
&lt;/h4&gt;

&lt;p&gt;On Friday mornings we have our weekly globaldatanet meeting. In 30 minutes the team can exchange information about the different tasks within the week. It's always a good opportunity to stay up to date with what my colleagues are currently working on, even if you are not working on the same project. Mainly for the day, I was still working on the creation of the tool for IAM and also did spend some time reviewing the code and features developed by a colleague for a previous customer project. Currently, we are working on the security competency from AWS, so we dedicated some time on Friday to prepare for the requirements and the external audit.&lt;br&gt;
As for every Friday, our team ends the week with our 🦾 Tech &amp;amp; Beer 🍺. This week Anton shared his journey on how to add custom checks to checkov. Always a highlight and a nice way of ending the week. Unfortunately, right now office time is rare otherwise the Tech &amp;amp; Beer usually is a good starting point for some further drinking and spending some time with the team after work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlight of the month 🚀
&lt;/h2&gt;

&lt;p&gt;For me, it was the possibility to show the AWS Team the work we have done for customer A throughout the last year. Wrapping up our developed services like dashboards and an Account Factory. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/webq2HO6O_edQ-Y6-m_lDtdNEhjq1wSIsxCtuyAy9g8/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvejYw/b3hnMDVyMHgycThl/c3Q0MTAucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/webq2HO6O_edQ-Y6-m_lDtdNEhjq1wSIsxCtuyAy9g8/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvejYw/b3hnMDVyMHgycThl/c3Q0MTAucG5n" alt="AWS Meeting" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Most important Tools and Service used this week 🛠
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"week"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"Id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"16"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"AWS-Services"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"AWS CloudFormation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"AWS CloudTrail"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"AWS Config"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"Amazon CloudFront"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"AWS Cost Explorer"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"AWS Lambda"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"AWS Key Management Service"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"Amazon Athena"&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"Languages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"Python"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="s2"&gt;"nodejs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"Tools"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ORGTOOL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                        &lt;/span&gt;&lt;span class="nl"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/daknhh/aws-orgtool"&lt;/span&gt;&lt;span class="w"&gt;

                    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cfn-python-lint"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                        &lt;/span&gt;&lt;span class="nl"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/aws-cloudformation/cfn-python-lint"&lt;/span&gt;&lt;span class="w"&gt;

                    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cfn-diagram"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                        &lt;/span&gt;&lt;span class="nl"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/mhlabs/cfn-diagram"&lt;/span&gt;&lt;span class="w"&gt;

                    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Taskfile"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                        &lt;/span&gt;&lt;span class="nl"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/Wildhoney/Taskfile"&lt;/span&gt;&lt;span class="w"&gt;

                    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Bottom line ❤️
&lt;/h2&gt;

&lt;p&gt;At globaldatanet, I can work with colleagues but also spend time with friends. Whether it's the lunch break together, a drink (or a few ;)) after work, or just a quick chat in between. Throughout my different projects, I have the possibility to work with an exciting tech stack in different industries while using the cutting edge technologies, especially related to AWS Services. I like the flexibility and the start-up feeling that globaldatanet retained, meaning flat hierarchies, quick decisions and the possibility to participate in a lot of cool things and internal decisions.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
    </item>
    <item>
      <title>Optimize your workloads for Sustainability</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:37:33 +0000</pubDate>
      <link>https://community.ops.io/daknhh/optimize-your-workloads-for-sustainability-3g49</link>
      <guid>https://community.ops.io/daknhh/optimize-your-workloads-for-sustainability-3g49</guid>
      <description>&lt;p&gt;Sustainability means "meeting the needs of the present without compromising the ability of future generations to meet their needs," according to the Brundtland Commission. For cloud sustainability, it means addressing the long-term environmental, economic, and societal impact of your business activities. Last year at re:invent 2021 AWS introduced the new &lt;a href="https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/sustainability-pillar.html"&gt;Sustainability Pillar&lt;/a&gt; for &lt;a href="https://aws.amazon.com/architecture/well-architected/"&gt;AWS Well-Architected Framework&lt;/a&gt; and at the beginning of this year AWS introduced the &lt;a href="https://aws.amazon.com/blogs/aws/new-customer-carbon-footprint-tool/"&gt;AWS Customer Carbon Footprint&lt;/a&gt; Tool. According to the energy transition plan, Amazon is on the path to powering its operations with 100% renewable energy by 2025. But environmental sustainability &lt;a href="https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/the-shared-responsibility-model.html"&gt;is a shared responsibility&lt;/a&gt; between you and AWS. This means that AWS maintains the sustainability of the cloud by delivering efficient, shared infrastructure, and you should optimize your workload to efficiently use these resources.&lt;/p&gt;

&lt;p&gt;In this post, I will use the design principles for sustainability in the cloud from the Sustainability Pillar of the Well-Architected Framework to explain how to design your workloads to maximize sustainability and minimize impact.&lt;/p&gt;

&lt;p&gt;Design Principles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Understand your impact.&lt;/li&gt;
&lt;li&gt;  Establish sustainability goals.&lt;/li&gt;
&lt;li&gt;  Maximize utilization.&lt;/li&gt;
&lt;li&gt;  Anticipate and adopt new, more efficient hardware and software offerings.&lt;/li&gt;
&lt;li&gt;  Use managed services.&lt;/li&gt;
&lt;li&gt;  Reduce the downstream impact of your cloud workloads.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Understand your impact
&lt;/h3&gt;

&lt;p&gt;Understand your workload’s environmental impact using metrics to see if you meet your sustainability goals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://aws.amazon.com/blogs/aws/new-customer-carbon-footprint-tool/"&gt;AWS Customer Carbon Footprint&lt;/a&gt; Tool&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/11/aws-compute-optimizer-resource-efficiency-metrics/"&gt;AWS Compute Optimizer now offers resource efficiency metrics&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/monitoring-cloudwatch.html"&gt;RDS Utilization Metrics&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Establish sustainability goals&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Establishing short and long-term sustainability goals for your workload, such as reducing the computed resources required per transaction or improving the power efficiency of your compute workload, reducing the network data traveled per request. For example, even if you are not able to go serverless with your application in the first step, you can start to decouple parts of your workload and create small functions to get there in the long run. Other options would include containerizing your workloads or improving the energy efficiency of your compute load by moving to Graviton2-based instances and/or functions. There are multiple transformation guides for transitioning workloads to AWS Graviton2 (&lt;a href="https://github.com/aws/aws-graviton-getting-started/blob/main/transition-guide.md"&gt;EC2&lt;/a&gt;, &lt;a href="https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-arm-based-aws-graviton2-processors/"&gt;Lambda&lt;/a&gt;, &lt;a href="https://aws.amazon.com/blogs/database/key-considerations-in-moving-to-graviton2-for-amazon-rds-and-amazon-aurora-databases/"&gt;RDS &amp;amp; Aurora&lt;/a&gt; ). &lt;a href="https://github.com/aws/aws-graviton-getting-started/blob/main/managed_services.md"&gt;Here is also a nice list of AWS services where graviton processors are available&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To reduce the network data traveled per request, I can recommend you to use a CDN. When requested, the static content is cached from the original server and delivers it to the user. This shortens the distance each packet has to travel. If you use CloudFront as your CDN, you should also &lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html"&gt;enable automatic compression&lt;/a&gt; - it will compress certain types of files and serve the compressed objects when viewers support them.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Maximize utilization&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use tools like &lt;a href="https://github.com/alexcasalboni/aws-lambda-power-tuning"&gt;AWS lambda power tuning&lt;/a&gt;, and &lt;a href="https://aws.amazon.com/compute-optimizer/"&gt;AWS Compute Optimizer&lt;/a&gt; to right-size your resources. In addition, you should use Auto Scaling to automatically scale up and down based on demand. To improve the overall resource efficiency and reduce idle capacity in the entire Cloud AWS, use &lt;a href="https://aws.amazon.com/aws-cost-management/aws-cost-optimization/spot-instances/"&gt;Amazon EC2 Spot Instances&lt;/a&gt;&lt;strong&gt;.&lt;/strong&gt; Spot Instances are unused EC2 capacity in AWS, this instance also gives you up to a 90% discount compared to On-Demand prices. If you are using EKS you should follow the &lt;a href="https://aws.github.io/aws-eks-best-practices/"&gt;EKS Best Practices Guides&lt;/a&gt; - especially the Auto Scaling guide to improve the utilization of your nodes. Moreover, you should generally adopt a serverless, event-driven architecture to maximize overall resource utilization.&lt;/p&gt;

&lt;p&gt;To improve the utilization of your AWS storage layer, you should analyze data access patterns to move the storage to different storage classes, with efficient long-term storage, you will optimize your storage footprint. To automatically move the data to another storage class or delete unused data, you can use lifecycle configurations. The following services can configure the lifecycle of your data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html"&gt;s3&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://docs.aws.amazon.com/de_de/AWSEC2/latest/UserGuide/snapshot-lifecycle.html"&gt;EBS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/API_Lifecycle.html"&gt;Backup&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/howitworks-ttl.html"&gt;DynamoDB&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Anticipate and adopt new, more efficient hardware and software offerings&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;As already mentioned in the Establish sustainability goals section, you should always make sure to use the latest hardware generation such as Graviton processors, or when it comes to GPU usage you should use flexible graphics acceleration rather than dedicated GPU instances. The same counts for your software and its dependencies. Not only from the security aspect, you should always stay up to date or maybe change to a newer programming language that uses hardware resources even more efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Use managed services&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use managed services, such as &lt;a href="https://aws.amazon.com/blogs/aws/amazon-msk-serverless-now-generally-available-no-more-capacity-planning-for-your-managed-kafka-clusters/"&gt;Amazon MSK Serverless (GA since 28 April 2022)&lt;/a&gt;, &lt;a href="https://aws.amazon.com/rds/aurora/serverless/"&gt;Amazon Aurora Serverless v2&lt;/a&gt;, or &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-sagemaker-serverless-inference/?nc1=h_ls"&gt;Amazon SageMaker Serverless Inference&lt;/a&gt;, to help distributing workloads while reducing the overall amount of infrastructure required. This also shifts the responsibility of sustainability optimization to AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Reduce the downstream impact of your cloud workloads&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To reduce the amount of energy that is required to use your services always stay up to date with the evolution of hardware and software features like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Use efficient programming languages like &lt;a href="https://aws.amazon.com/blogs/opensource/sustainability-with-rust/"&gt;Rust&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Use efficient processors to run your workloads like &lt;a href="https://aws.amazon.com/ec2/graviton/"&gt;Graviton&lt;/a&gt; - the newest generation 3 will consume up to 60% less energy than the generation 2&lt;/li&gt;
&lt;li&gt;  Analyze the performance of your application using CloudWatch Logs Insights to find the performance guzzler&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/2jL7BZ_rPtcG63itV8FWJk6ijrqbsAQX4TlQtpBTWfg/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvamNm/dXJxazI4cnN0dWJ3/cWM0emIuanBlZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/2jL7BZ_rPtcG63itV8FWJk6ijrqbsAQX4TlQtpBTWfg/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvamNm/dXJxazI4cnN0dWJ3/cWM0emIuanBlZw" alt="Image" width="880" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We at globaldatanet also want to contribute to making the world a little greener and better. Therefore, we have decided to work with Eden Reforestation Projects, one of the world's best reforestation partners, and from now on we will plant 1000 new trees every single month. If you want to learn more about that, have a look at our &lt;a href="https://globaldatanet.com/sustainability"&gt;sustainability&lt;/a&gt; page.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>sustainability</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Introducing the AWS Firewall Factory</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:36:42 +0000</pubDate>
      <link>https://community.ops.io/daknhh/introducing-the-aws-firewall-factory-5848</link>
      <guid>https://community.ops.io/daknhh/introducing-the-aws-firewall-factory-5848</guid>
      <description>&lt;p&gt;A few days ago we introduced our &lt;a href="https://github.com/globaldatanet/aws-firewall-factory"&gt;AWS Firewall Factory&lt;/a&gt;. A simple solution that helps you deploy, update, and stage your Web Application Firewalls while managing them centrally via AWS Firewall Manager.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are Web Application Firewalls?
&lt;/h2&gt;

&lt;p&gt;AWS Web Application Firewalls (WAFs) protect web applications and APIs from typical attacks from the Internet that can compromise security and availability, and put undue strain on servers and resources. The AWS WAF provides prebuilt security rules that help to control bot traffic and block attack patterns. However, with its help, you can also create your own rules based on your specific requirements. In simple scenarios and for smaller applications, this is very easy to implement on an individual basis. However, in larger environments with tens or even hundreds of applications, it is advisable to aim for central governance and automation. If you want to learn more about this solution or Web application firewalls in general feel free to register to this &lt;a href="https://globaldatanet.com/webinars/aws-security-with-security-in-the-cloud"&gt;event&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;Let's take a quick look at the solution architecture. In order to be able to provision WAFs using AWS Firewall Manager to other accounts we first need to set the Firewall Manager administrator account in our AWS Organization. Additionally we need to have a central S3 Bucket which we will use for our WAF logs. The logs we could use to see potential false positives to develop custom WAF rules. The easiest way to do this is to query the S3 bucket via Athena.&lt;/p&gt;

&lt;p&gt;But first you should just start with ManagedRuleGroups to have a base set to secure your applications. AWS Managed Rules for AWS WAF is a managed service that provides protection against common application vulnerabilities or other unwanted traffic, without having to write your own rules.&lt;/p&gt;

&lt;p&gt;After deploying your first firewall and using ManagedRuleGroups to detect errors in your application, you can use aforementioned s3 log bucket to create queries and define your own custom rules using the false positives. You do this simply by defining the RuleStatements around your statements in your value file. During the deployment process, the solution calculates the required capacity using the CheckCapacity API from AWS and creates RuleGroups that are attached to the WAF. We have also developed an algorithm that pads the RuleGroups to the maximum RuleGroup size and only then creates a new RuleGroup.&lt;/p&gt;

&lt;p&gt;All settings where the WAF should be deployed and with which settings (should be made) are controlled via the dedicated value file. Currently we only support a deployment via Taskfile. Later we will also support deployments via Teamcity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/gug_zr97XPU27GgmmZh9chcJadIuNOwqpYmkCCMd0VA/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvaTl1/NDBmdDhxdHJ1NnNk/ZW0zNnUucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/gug_zr97XPU27GgmmZh9chcJadIuNOwqpYmkCCMd0VA/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvaTl1/NDBmdDhxdHJ1NnNk/ZW0zNnUucG5n" alt="Image description" width="651" height="711"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Currently implemented Features
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Automated Capacity Calculation via API - CheckCapacity&lt;/li&gt;
&lt;li&gt;Algorithm to split Rules into RuleGroups&lt;/li&gt;
&lt;li&gt;Automated Update of RuleGroup if Capacity Changed&lt;/li&gt;
&lt;li&gt;Add ManagedRuleGroups via configuration file&lt;/li&gt;
&lt;li&gt;Automated Generation of draw.io diagram for each WAF&lt;/li&gt;
&lt;li&gt;Checking of the softlimit quota for WCU set in the AWS Account (Stop deployment if Calculated WCU is above the quota)&lt;/li&gt;
&lt;li&gt;Easy configuration of WAF Rules trough json file.&lt;/li&gt;
&lt;li&gt;Deployment Hash to deploy same WAF more than one time for testing and/or blue/green deployments.&lt;/li&gt;
&lt;li&gt;Stopping deployment if soft limit will be exceeded: Firewall Manager policies per organization per Region (L-0B28E140) - Maximum number of web ACL capacity units in a web ACL in WAF for regional (L-D9F31E8A)&lt;/li&gt;
&lt;li&gt;NEW RegexMatchStatement and IPSetReferenceStatement is working now 🚀&lt;/li&gt;
&lt;li&gt;NEW You can now name your Rules. If you define a Name in your RulesArray the Name + a Base36 Timestamp will be used for creation of your Rule - otherwise a name will be generated. This will help you to query your logs in Athena. The same Rulename also apply to the metric just with adding "-metric" to the name.&lt;/li&gt;
&lt;li&gt;New Support for Captcha - You can now add Captcha as Action to your WAFs. This help you to block unwanted bot traffic by requiring users to successfully complete challenges before their web request are allowed to reach AWS WAF protected resources. AWS WAF Captcha is available in the US East (N. Virginia), US West (Oregon), Europe (Frankfurt), South America (Sao Paulo), and Asia Pacific (Singapore) AWS 
Regions and supports Application Load Balancer, Amazon API Gateway, and AWS AppSync resources.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We hope you'll find this solution helpful to secure your environment! If you have any feedback about the solution, please feel free to &lt;a href="//hello@globaldatanet.com"&gt;reach out&lt;/a&gt; to us or open a &lt;a href="https://github.com/globaldatanet/aws-firewall-factory/issues"&gt;github issue&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>waf</category>
      <category>security</category>
      <category>cdk</category>
    </item>
    <item>
      <title>CloudFormation vs. Terraform</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:35:52 +0000</pubDate>
      <link>https://community.ops.io/daknhh/cloudformation-vs-terraform-3c1c</link>
      <guid>https://community.ops.io/daknhh/cloudformation-vs-terraform-3c1c</guid>
      <description>&lt;p&gt;What are the differences? Which tool is the best for your needs?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/RyGNV1moCADPtgNCn7D78N5UCu0Yyj1r7QR0W1oxG3E/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvOTR3bGN6/c2Q3bnpheG0yMGhk/aWgucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/RyGNV1moCADPtgNCn7D78N5UCu0Yyj1r7QR0W1oxG3E/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvOTR3bGN6/c2Q3bnpheG0yMGhk/aWgucG5n" alt="CDK vs. CloudFormation vs. Terraform vs. Pulumi" width="658" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you want to implement infrastructure as code, you always come to the question if you should use CloudFormation or HashiCorp's open-source tool &lt;a href="https://www.terraform.io/"&gt;Terraform&lt;/a&gt;. Both have their advantages and disadvantages. I compared both in the following table to help you decide which tool is best suited for your needs. &lt;/p&gt;

&lt;h3&gt;
  
  
  Update
&lt;/h3&gt;

&lt;p&gt;Since there was a lot of feedback that you would like to have a comparison including the &lt;a href="https://github.com/aws/aws-cdk"&gt;AWS CDK&lt;/a&gt;, I expanded the table by one column for the AWS CDK. I hope the table will help you to make the decision for the right tool for you.&lt;/p&gt;

&lt;p&gt;⁉️ Some people asked me to add &lt;a href="https://www.pulumi.com/"&gt;Pulumi&lt;/a&gt; as well to the table - here is your update 🚀. &lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;&lt;img src="https://community.ops.io/images/k4oOIQWus69x5X7BDqz5q07xgl4t-Cy9GJNbCQ2we6I/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvcmw2NTA0/OTN4ZmVtZjl6ODNt/bGMucG5n" alt="AWS CDK" width="75" height="75"&gt;&lt;/th&gt;
&lt;th&gt;&lt;img src="https://community.ops.io/images/JAAAmtZmmB7L5pVJ8t0Xg7dVcKf3AJIfa7uq3nIQcmM/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvZTluamQ5/YTQxNTNqdmRnbHN5/YnYucG5n" alt="CloudFormation" width="75" height="75"&gt;&lt;/th&gt;
&lt;th&gt;&lt;img src="https://community.ops.io/images/jKeKwnbOQDLVMgfCvJIMqYUx4EFHDf7iL91YusYP0ik/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvejQ4cXhz/YTQxeHhibzV1NWlx/dHUucG5n" alt="Terraform" width="66" height="75"&gt;&lt;/th&gt;
&lt;th&gt;&lt;img src="https://community.ops.io/images/DWBI0SOya7eMHQuQQKoAz0ikBik4bbqoqKKoPg8Qja8/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvanF6a2lt/aGRiazB1Y2UzbXVv/eXAucG5n" alt="Pulumi" width="75" height="75"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Supported AWS Resources&lt;/td&gt;
&lt;td&gt;500+&lt;/td&gt;
&lt;td&gt;500+&lt;/td&gt;
&lt;td&gt;400+&lt;/td&gt;
&lt;td&gt;400+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration of new features after announcement&lt;/td&gt;
&lt;td&gt;➖ After announcement of a new feature there is always a delay until it is integrated into CDK, but you can use &lt;a href="https://docs.aws.amazon.com/cdk/latest/guide/cfn_layer.html"&gt;Escape Hatches&lt;/a&gt; to workaround these missing features.&lt;/td&gt;
&lt;td&gt;➖  After announcement of a new feature there is always a delay until it is integrated into CloudFormation, but as a workaround you can develop &lt;strong&gt;custom resources&lt;/strong&gt; to cover new features.&lt;/td&gt;
&lt;td&gt;➖ After announcement of a new feature there is always a delay until it is integrated into Terraform, but as a workaround you can use &lt;a href="https://github.com/antonbabenko/terraform-aws-anything"&gt;terraform-aws-anything&lt;/a&gt; to cover new features.&lt;/td&gt;
&lt;td&gt;➖ After announcement of a new feature there is always a delay until it is integrated into Pulumi.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;License and Support&lt;/td&gt;
&lt;td&gt;➖  Open-source with support from AWS.&lt;/td&gt;
&lt;td&gt;➖  Free with support from AWS and large community.&lt;/td&gt;
&lt;td&gt;➖  Open-source with support from Hashicorp and large community.&lt;/td&gt;
&lt;td&gt;➖  Open-source with support from Pulimi and large community.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Third Party&lt;/td&gt;
&lt;td&gt;✅   CDK supports third-party resources.&lt;/td&gt;
&lt;td&gt;✅   CloudFormation supports third-Party vendors to create resource providers.&lt;/td&gt;
&lt;td&gt;✅   Terraform supports third-party providers and provisioners.&lt;/td&gt;
&lt;td&gt;✅   Pulumi supports third-party providers.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLI&lt;/td&gt;
&lt;td&gt;✅  &lt;strong&gt;CDK CLI&lt;/strong&gt; enables you to list the stacks defined in your CDK app, synthesize the stacks into CloudFormation templates, determine the differences between running stack instances and the stacks defined in your CDK code and deploy stacks to any public AWS Region.&lt;/td&gt;
&lt;td&gt;✅   CloudFormation has a CLI that enables you to develop and test AWS and third-party resources and register them for use in AWS CloudFormation.&lt;/td&gt;
&lt;td&gt;✅   Terraform has a single command-line application.&lt;/td&gt;
&lt;td&gt;✅   Pulumi has a single command-line application.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Language&lt;/td&gt;
&lt;td&gt;✅  Supports multiple programming languages &lt;strong&gt;Typescript&lt;/strong&gt;, &lt;strong&gt;Javascript&lt;/strong&gt;, &lt;strong&gt;Python&lt;/strong&gt;, &lt;strong&gt;Java&lt;/strong&gt;, and &lt;strong&gt;C#&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;➖  &lt;strong&gt;JSON&lt;/strong&gt; / &lt;strong&gt;YAML&lt;/strong&gt; - YAML is easier to read than JSON but it forces you to have multiple nested scopes.&lt;/td&gt;
&lt;td&gt;✅  &lt;strong&gt;HCL&lt;/strong&gt; is human readable as well as machine-friendly.&lt;/td&gt;
&lt;td&gt;✅  Supports multiple programming languages &lt;strong&gt;Typescript&lt;/strong&gt;, &lt;strong&gt;Javascript&lt;/strong&gt;, &lt;strong&gt;Python&lt;/strong&gt;, &lt;strong&gt;Go - in preview&lt;/strong&gt;, and &lt;strong&gt;C# - in preview&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Modularization&lt;/td&gt;
&lt;td&gt;✅  CDK supports modules to create a reproducible infrastructure.&lt;/td&gt;
&lt;td&gt;➖  &lt;strong&gt;Nested stacks&lt;/strong&gt; and cross-stack references can be used to achieve modularization.&lt;/td&gt;
&lt;td&gt;✅  Terraform modules help to create a reproducible infrastructure.&lt;/td&gt;
&lt;td&gt;✅  Pulumi modules help to create a reproducible infrastructure.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State Management&lt;/td&gt;
&lt;td&gt;✅  Deploys CloudFormation Stacks to manage its state.&lt;/td&gt;
&lt;td&gt;✅  Uses Stacks to manage its state.&lt;/td&gt;
&lt;td&gt;✅  By default saves the state locally but it is possible to save the state in Terraform Cloud, S3 or DynamoDB with the remote state feature.&lt;/td&gt;
&lt;td&gt;✅  Pulumi saves the state (called &lt;strong&gt;checkpoint&lt;/strong&gt;) locally but it is possible to save the state in Pulumi service backend or S3.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration&lt;/td&gt;
&lt;td&gt;✅  Supports Environment Variables, CloudFormation Parameters or you can get values from SSM.&lt;/td&gt;
&lt;td&gt;✅  Supports up to 60 Parameters. Import values from output of another stack or import from SSM.&lt;/td&gt;
&lt;td&gt;✅  Data sources allow data to be fetched or computed for use elsewhere in Terraform configuration.&lt;/td&gt;
&lt;td&gt;✅  Pulumi offers  a &lt;strong&gt;Config&lt;/strong&gt; object with various getters and setters for retrieving values, in addition they have Data sources that allow  to grep, for example an AMI or an AZ from AWS.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Change management&lt;/td&gt;
&lt;td&gt;✅   &lt;strong&gt;cdk diff&lt;/strong&gt; compares the desired state against the stack but it doesn't look at the deployed resources until you deploy. You only find out about discrepancies between the stack and deployed resources at deployment time.&lt;/td&gt;
&lt;td&gt;✅  &lt;strong&gt;Change Sets&lt;/strong&gt; help you to verify changes before you apply them on your stack.&lt;/td&gt;
&lt;td&gt;✅  &lt;strong&gt;terraform plan&lt;/strong&gt; creates a detailed execution plan before applying your changes.&lt;/td&gt;
&lt;td&gt;✅  &lt;strong&gt;pulumi preview&lt;/strong&gt; previews your changes explicitly before deploying.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Error handling and rollback&lt;/td&gt;
&lt;td&gt;✅   AutoRollbackConfig helps you to configure the behavior of automatically rolling back for a given Deployment Group.&lt;/td&gt;
&lt;td&gt;✅  CloudFormation automatically rolls back to the last working state.&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌ Currently there is no rollback functionality in Pulumi but there is an &lt;a href="https://github.com/pulumi/pulumi/issues/96"&gt;open RFC&lt;/a&gt; to implement this functionality.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import Existing Resources&lt;/td&gt;
&lt;td&gt;❌  Currently its not possible to import resources into CDK, but there is an &lt;a href="https://github.com/aws/aws-cdk-rfcs/issues/84"&gt;open RFC&lt;/a&gt; to implement this functionality. Additional information - there are workarounds how to use &lt;a href="https://garbe.io/blog/2019/09/20/hey-cdk-how-to-use-existing-resources/"&gt;existing resources&lt;/a&gt; in CDK.&lt;/td&gt;
&lt;td&gt;➖  It is possible to import resources into CloudFormation but only for a few resources.&lt;/td&gt;
&lt;td&gt;➖ It is possible to import resources into terraform but it does not generate configuration.&lt;/td&gt;
&lt;td&gt;✅Pulumi offers an &lt;strong&gt;import&lt;/strong&gt; resource option to request that a resource defined in your Pulumi program adopts an existing resource in the cloud provider instead of creating a new one.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rolling updates for Auto-Scaling Groups&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅  You can implement rolling updates for Auto-Scaling Groups  using the &lt;strong&gt;create before destroy&lt;/strong&gt; lifecycle policy.&lt;/td&gt;
&lt;td&gt;✅  You can implement rolling updates for Auto-Scaling Groups  using the &lt;strong&gt;createBeforeDestroy&lt;/strong&gt; lifecycle policy.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;External waiting conditions&lt;/td&gt;
&lt;td&gt;✅  You can use &lt;strong&gt;CfnWaitCondition&lt;/strong&gt; to coordinate resource creation with configuration actions that are external to the stack creation.&lt;/td&gt;
&lt;td&gt;✅  You can use &lt;strong&gt;WaitCondition&lt;/strong&gt; to coordinate resource creation with configuration actions that are external to the stack creation.&lt;/td&gt;
&lt;td&gt;✅  You can use &lt;a href="https://www.terraform.io/docs/providers/null/resource.html"&gt;null_resource&lt;/a&gt; to coordinate resource creation with configuration actions that are external to native Terraform resources.&lt;/td&gt;
&lt;td&gt;✅  You pass a &lt;strong&gt;customTimeouts&lt;/strong&gt; object as part of resource options to coordinate resource creation with configuration actions that are external to the resource.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Drift Detection&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visualization of dependencies&lt;/td&gt;
&lt;td&gt;✅  CDK has a plugin for Visual Studio Code which visualizes dependencies or you can use the &lt;a href="https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md#visualizing-dependencies-in-a-cloudformation-template"&gt;cli&lt;/a&gt;.&lt;/td&gt;
&lt;td&gt;✅  You can use the AWS CloudFormation Designer to view CloudFormation templates.&lt;/td&gt;
&lt;td&gt;✅  You can use the &lt;strong&gt;terraform graph&lt;/strong&gt; command to generate a visual representation of either a configuration or execution plan.&lt;/td&gt;
&lt;td&gt;✅  You can use &lt;strong&gt;pulumi stack graph&lt;/strong&gt; to export a stack’s dependency graph to a file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-Cloud Management&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>aws</category>
      <category>terraform</category>
      <category>iac</category>
      <category>cdk</category>
    </item>
    <item>
      <title>SSH and SCP with AWS SSM</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:33:54 +0000</pubDate>
      <link>https://community.ops.io/daknhh/ssh-and-scp-with-aws-ssm-2g5b</link>
      <guid>https://community.ops.io/daknhh/ssh-and-scp-with-aws-ssm-2g5b</guid>
      <description>&lt;p&gt;Using AWS Session Manager with enhanced SSH and SCP capability to connect to your EC2 without using firewalls and bastion hosts&lt;/p&gt;

&lt;p&gt;Amazon Web Services recently &lt;a href="https://aws.amazon.com/de/about-aws/whats-new/2019/07/session-manager-launches-tunneling-support-for-ssh-and-scp/"&gt;announced&lt;/a&gt; new capabilities in the AWS Systems Manager Session Manager. Users are now capable of tunneling SSH (Secure Shell) and SCP (Secure Copy) connections directly from a local client without the need for the AWS management console.&lt;/p&gt;

&lt;p&gt;For years, users have relied on firewalls and bastion hosts in order to securely access cloud assets, but these options have security and management overhead tradeoffs. The Session Manager allows for secure, audited console access to cloud resources without the need for additional ingress points.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/F_pCoWZ1Eoyd_RQ1EyelhsutW133YjgnkXVFNJQv57M/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvOHhtcDg1/NmMzcTRuaXZnYnRo/dGEucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/F_pCoWZ1Eoyd_RQ1EyelhsutW133YjgnkXVFNJQv57M/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvOHhtcDg1/NmMzcTRuaXZnYnRo/dGEucG5n" alt="AWS SSM" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Local Prerequisites
&lt;/h2&gt;

&lt;p&gt;In order to perform SCP and SSH operations from your local host to the remote cloud asset, you will need to perform the following setup steps on your client.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install the latest AWS CLI
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html"&gt;Update&lt;/a&gt; to the latest AWS CLI – An updated command line interface is required on your local host in order to use these new Session Manager features. The version of the AWS CLI should be at least 1.16.213.&lt;/p&gt;

&lt;p&gt;How to get the version: &lt;code&gt;aws --version&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Install the Session Manager Plugin
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html"&gt;Install&lt;/a&gt; the Session Manager Plugin – This plugin allows the AWS cli to launch Session Manager sessions with your local SSH client. The Version should be should be at least 1.1.26.0.&lt;/p&gt;

&lt;p&gt;How to get the version: &lt;code&gt;session-manager-plugin --version&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Update local host SSH config
&lt;/h3&gt;

&lt;p&gt;The tricky portion of this setup involves altering your local host SSH configuration in order to proxy commands through the AWS session manager for any aws ec2 instance-id.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://gist.github.com/qoomon/fcf2c85194c55aee34b78ddcaa9e83a1"&gt;Download&lt;/a&gt; AWS SSM SSH ProxyCommand&lt;/li&gt;
&lt;li&gt;Move this script to &lt;code&gt;~/.ssh/aws-ssm-ec2-proxy-command.sh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Make it executable &lt;code&gt;chmod +x ~/.ssh/aws-ssm-ec2-proxy-command.sh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add following entry to your &lt;code&gt;~/.ssh/config&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;host i-&lt;span class="k"&gt;*&lt;/span&gt; mi-&lt;span class="k"&gt;*&lt;/span&gt;
  ProxyCommand ~/.ssh/aws-ssm-ec2-proxy-command.sh %h %r %p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  EC2 Prerequisites
&lt;/h2&gt;

&lt;p&gt;You will need to perform the following setup steps on your target EC2 instance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Instance Profile
&lt;/h3&gt;

&lt;p&gt;By default, AWS Systems Manager doesn't have permission to perform actions on your instances. You must grant access by using an AWS Identity and Access Management (IAM) instance profile. An instance profile is a container that passes IAM role information to an Amazon Elastic Compute Cloud (Amazon EC2) instance at launch. You need to add SSM permission to your &lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/setup-instance-profile.html"&gt;Instance Profile&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SSM Agent
&lt;/h3&gt;

&lt;p&gt;Ensure the latest SSM Agent on Target Instance&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
service amazon-ssm-agent restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Firewall Configuration
&lt;/h3&gt;

&lt;p&gt;Ensure the security group allow outbound to System Manager. No inbound ssh port is required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Once these steps are complete, you will be ready to initiate SSH and SCP connections to your cloud assets directly from your local machine.&lt;/p&gt;

&lt;p&gt;Obtain the instance-id of the cloud asset. This can be done via the AWS management console or with the AWS cli command &lt;code&gt;aws ec2 describe-instances&lt;/code&gt;, and will have a format similar to &lt;code&gt;i-0ba3d05e2b6c0fb36&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;SSH can be performed as normal using the instance-id as the hostname. Most SSH command line switches can be used such as using a key in the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export AWS_PROFILE='default'
ssh ec2-user@i-0ba3d05e2b6c0fb36
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These connections are secured by IAM access and generate cloudtrail events for logging and monitoring.&lt;/p&gt;

&lt;p&gt;While immutable infrastructure is a desired goal for multiple reasons, many will find themselves with a need to access or alter systems running live. The AWS Systems Manager Session Manager allows this capability without the need for additional firewall ingress or bastion hosts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update: Use SSO with AWS CLI v2 to connect to EC2 over SSH using SSM
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Prerequistes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://globaldatanet.com/blog/aws-cli-v2-preview-with-aws-sso"&gt;Install and configure AWS CLI v2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install the Session Manager Plugin&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Login via SSO - AWS CLI v2 to connect to an EC2 over SSH using SSM
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Update local host SSH config&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add following entry to your &lt;code&gt;~/.ssh/config&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# SSH over Session Manager&lt;/span&gt;
host i-&lt;span class="k"&gt;*&lt;/span&gt; mi-&lt;span class="k"&gt;*&lt;/span&gt;
  IdentityFile ~/.ssh/id_rsa
  ProxyCommand ~/.ssh/aws-ssm-ec2-proxy-command.sh %h %r %p ~/.ssh/id_rsa.pub
  StrictHostKeyChecking no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Login to &lt;strong&gt;AWS SSO&lt;/strong&gt; &lt;code&gt;aws2 sso login --profile default&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Export &lt;strong&gt;AWS_PROFILE&lt;/strong&gt; &lt;code&gt;export AWS_PROFILE='default'&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSH into your instance by using the following command.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i /path/my-key-pair.pem ec2-user@instance-id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>aws</category>
      <category>security</category>
      <category>ssh</category>
      <category>scp</category>
    </item>
    <item>
      <title>Creating and managing Accounts in AWS</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:32:14 +0000</pubDate>
      <link>https://community.ops.io/daknhh/creating-and-managing-accounts-in-aws-1b1o</link>
      <guid>https://community.ops.io/daknhh/creating-and-managing-accounts-in-aws-1b1o</guid>
      <description>&lt;p&gt;&lt;a href="https://community.ops.io/images/XGrOTfzTEpcv1FI33urdnDavieLkQzfy9JEH6VNzuC4/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvb292dWMw/eW41bWczb290NG5o/dDcucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/XGrOTfzTEpcv1FI33urdnDavieLkQzfy9JEH6VNzuC4/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kvb292dWMw/eW41bWczb290NG5o/dDcucG5n" alt="" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;It's best practice to use multiple accounts to follow the least privilige principle. Each account should have different security &amp;amp; compliance controls and access patterns. Development accounts have security and compliance controls, they are typically less restrictive that a production account. Production accounts should never be accessed from a user or just with Read-Only access - each resource of these accounts should be created automatically using codepipelines. Whereas specific global management accounts like a security or central-logging account are limited to users which are part of a security or compliance team. The following post will show you how to create and manage accounts using best practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Automate account creation
&lt;/h2&gt;

&lt;p&gt;Automate the process of setting up Accounts that are secure, well-architected, and ready to use. If you use the Control Tower for your Landing Zone it's coming already with an &lt;a href="https://docs.aws.amazon.com/controltower/latest/userguide/account-factory.html"&gt;Account Factory&lt;/a&gt; - there's also already existent solutions to &lt;a href="https://aws.amazon.com/de/solutions/implementations/customizations-for-aws-control-tower/"&gt;customize&lt;/a&gt; the Account Factory to your needs. Even if you use the official landing zone solution there are some examples of &lt;a href="https://github.com/aws-samples/aws-account-vending-machine"&gt;Account vending machines&lt;/a&gt; on github.&lt;/p&gt;

&lt;p&gt;Followed you can see an example architecture of an Account Factory with examples on what kind of customization you can/should do.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/iuy8vD3RZXm3uvwdEEx7C5fYwz349EIuFsSbVlrz3pw/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kva3Nnbmd4/cWZ3OWhzNnJwbWM5/NzkucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/iuy8vD3RZXm3uvwdEEx7C5fYwz349EIuFsSbVlrz3pw/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL2kva3Nnbmd4/cWZ3OWhzNnJwbWM5/NzkucG5n" alt="Account Factory Example Architecture" width="800" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Track and inspect your costs
&lt;/h2&gt;

&lt;p&gt;Following FinOps principles is a must these days and will persist for a long time. So be aware and track/inspect your costs to be able to save some in the end. &lt;br&gt;
If you want to learn more about FinOps take a look at this &lt;a href="https://globaldatanet.com/blog/finops-tools-for-your-daily-work"&gt;post&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  2.1 Budget notification
&lt;/h2&gt;

&lt;p&gt;Define and use budgets. Set up notifications using &lt;a href="https://github.com/globaldatanet/aws-budget-alarms"&gt;Slack&lt;/a&gt;, &lt;a href="//files/budget-alarm-via-teams.json"&gt;Teams&lt;/a&gt; or &lt;a href="//files/budget-alarm-via-mail.json"&gt;Email&lt;/a&gt; to warn you if you're about to exceed your allocated amount for cost or usage budgets. Additionally you should use cost allocation tags. When you tag your AWS resources, it’s much easier to organize, categorize and track your AWS costs. Cost allocation tags are useful for tracking expenditure on exploratory workloads in your accounts.&lt;/p&gt;
&lt;h2&gt;
  
  
  2.2 Inspect cost and usage
&lt;/h2&gt;

&lt;p&gt;To inspect your cost and usage you should create dashboards or use the Cost Explorer to display your past usage &amp;amp; cost and forecast expected spend. &lt;br&gt;
Here is an example workshop on how to create &lt;a href="https://wellarchitectedlabs.com/cost/200_labs/200_enterprise_dashboards/1_create_cost_intelligence/"&gt;cost intelligence dashoards&lt;/a&gt;. You should always check your usage spending for cost optimization as well - Cost Explorer or &lt;a href="https://www.linkedin.com/company/ohtru/"&gt;OHTRU&lt;/a&gt; will help you to save some cost.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Implement SCPs
&lt;/h2&gt;

&lt;p&gt;Prevent unwanted actions, save costs and apply appropriate SCPs to your accounts. When you design and implement SCPs be sure to put those accounts in specific organizational units. If you want to learn more about SCPs take a look at this blog post: &lt;a href="https://globaldatanet.com/blog/scp-best-practices"&gt;SCP best practices&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Use an auditing tool
&lt;/h2&gt;

&lt;p&gt;It is best practice to use CloudTrail as an auditing tool to continuously monitor API calls in your AWS environment. Those CloudTrail logs should be forwarded to your central &lt;a href="https://en.wikipedia.org/wiki/Security_information_and_event_management"&gt;SIEM&lt;/a&gt; - if you don't use a central SIEM you can use EventBridge to create rules that trigger on the information captured by CloudTrail eg.: if someone use the S3 API - PutBucketPublicAccessBlock. Those rule can trigger a Lambda to do automated remediation or send a notification to Slack, Teams or an Email.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Check your resources for compliance
&lt;/h2&gt;

&lt;p&gt;Use automated and continuous checks against rules in a set of security standards to identify non-compliant resources in your account. You can use Config &amp;amp; Config Rules or Security Hub for that. &lt;/p&gt;
&lt;h2&gt;
  
  
  5.1 Config
&lt;/h2&gt;

&lt;p&gt;Config is a continous management and monitoring service for your whole infrastructure. It captures snapshots of your configuration of resources and is able to check using Config Rules to detect for non-compliant resources.&lt;br&gt;
As a prerequisite we need to ensure that Config is activated in your AWS Region.&lt;br&gt;&lt;br&gt;
Config Aggregators with &lt;a href="https://docs.aws.amazon.com/config/latest/developerguide/querying-AWS-resources.html"&gt;advanced queries&lt;/a&gt; will help you to gain visibility about the compliance status of your whole organization.&lt;br&gt;
Config has already some &lt;a href="https://docs.aws.amazon.com/config/latest/developerguide/managed-rules-by-aws-config.html"&gt;manged rules&lt;/a&gt; which are easy to activate. Here is an example for a managed config rule activation using CloudFormation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Author: David Krohn&lt;/span&gt;
&lt;span class="na"&gt;AWSTemplateFormatVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;2010-09-09&lt;/span&gt;

&lt;span class="c1"&gt;#-----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;#Resources &lt;/span&gt;
&lt;span class="c1"&gt;#-----------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;CheckForS3BucketServerSideEncryption&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Config::ConfigRule&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;ConfigRuleName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS-s3-bucket-server-side-encryption-enabled&lt;/span&gt;
        &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checks that your Amazon S3 bucket either has S3 default encryption enabled or that the S3 bucket policy explicitly denies put-object requests without server side encryption.&lt;/span&gt;
        &lt;span class="na"&gt;Source&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;Owner&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS&lt;/span&gt;
            &lt;span class="na"&gt;SourceIdentifier&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;S3_BUCKET_SERVER_SIDE_ENCRYPTION_ENABLED&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5.2 Security Hub
&lt;/h2&gt;

&lt;p&gt;Security Hub continuously monitors your environment using automated security checks based on the best practices and industry standards that you want to follow. Security Hub provides controls for the following standards:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-cis.html"&gt;CIS AWS Foundations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-pcidss.html"&gt;Payment Card Industry Data Security Standard (PCI DSS)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-fsbp.html"&gt;AWS Foundational Security Best Practices&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you enable a standard, all of the controls for that standard are enabled by default. To adjust a standard to your needs (own compliancy requirements) you can then disable and enable specific controls within an enabled standard. &lt;br&gt;
To disable a control, you can use this API call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws securityhub update-standards-control &lt;span class="nt"&gt;--standards-control-arn&lt;/span&gt; &amp;lt;CONTROL_ARN&amp;gt; &lt;span class="nt"&gt;--control-status&lt;/span&gt; &lt;span class="s2"&gt;"DISABLED"&lt;/span&gt; &lt;span class="nt"&gt;--disabled-reason&lt;/span&gt; &amp;lt;DESCRIPTION&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;p&gt;To enable a control, use the following API call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws securityhub update-standards-control--standards-control-arn &amp;lt;CONTROL_ARN&amp;gt; &lt;span class="nt"&gt;--control-status&lt;/span&gt; &lt;span class="s2"&gt;"ENABLED"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  6. Access control
&lt;/h2&gt;

&lt;p&gt;Create individual identities to access AWS. As we all know we should create credentials for all users and resources on the one hand but also avoid creating long-term credentials in AWS on the other hand. In the following subsections I have two ideas how to tackle the problems to use AWS best practices for access control. &lt;/p&gt;

&lt;h3&gt;
  
  
  6.1 Federated access for users
&lt;/h3&gt;

&lt;p&gt;Use federated access to avoid long-term credentials to access the Management Console, call APIs, and access resources, without the need to create an IAM user for each identity. You can use Active Directory, any other identity provider with SAML2.0 and configure an IDP in each account, or you can use the &lt;a href="https://aws.amazon.com/de/single-sign-on/"&gt;AWS SSO&lt;/a&gt; service.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.2 Do not use access keys
&lt;/h3&gt;

&lt;p&gt;Long-term access keys, such as those associated with IAM users remain valid until you manually revoke them. In many scenarios you dont need to create access keys that never expire. You can create IAM roles and generate temporary security credentials using Security Token Service (STS) instead. IAM roles can be associated and comsumed by almost every resources such as EC2 Instances, Fargate, Lambdas or a mobile app etc. Even if you need to do a cross-account access, you can use an IAM role to establish trust between accounts. However when there is no way around to create access keys, you should think of creating a lambda which is taking care of keys being automatically rotated. In any case, try to avoid that credentials are not accidentally exposed to the whole world.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.3 Secure root user credentials
&lt;/h3&gt;

&lt;p&gt;Do not use the root user for daily work. In times of a global pandemic like right now - you may think about using a &lt;a href="https://www.vaultproject.io/"&gt;vault&lt;/a&gt; to mange the access to the root user credentials and MFA. Additionally you should use root activity monitor to get notified if someone is using the root user for activity. If you want to learn when you need to use the root user take a look at this blog post: &lt;a href="https://globaldatanet.com/blog/tasks-that-require-root-user"&gt;Tasks that require root user&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Resource lifecycle management
&lt;/h2&gt;

&lt;p&gt;Defining a lifecycle for your resources will help you to control costs, keep your resources up to date and saves it from being undocumented and unsupportable.&lt;/p&gt;

&lt;h2&gt;
  
  
  8.1 Development accounts
&lt;/h2&gt;

&lt;p&gt;In development accounts you should consider to define lifecycle policies for all resoures eg. delete S3 buckets or delete old instances. If you use CloudFormation to deploy all resources you could think of using automatic deletion of your stacks after a defined time. If you want to learn more about that - take a look at this post: &lt;a href="https://aws.amazon.com/blogs/infrastructure-and-automation/scheduling-automatic-deletion-of-aws-cloudformation-stacks/"&gt;Scheduling automatic deletion of AWS CloudFormation stacks&lt;/a&gt;. As we all know that in development accounts you sometimes just do some testing using manuall deployment via Console or CLI. You should take a look at &lt;a href="https://github.com/rebuy-de/aws-nuke"&gt;aws-nuke&lt;/a&gt;. aws-nuke is a tool that delete AWS resources automatically. In addition the tool is supporting filters which helps you to preserve some baseline resources. One idea would be to implement aws-nuke on a codebuild task which is triggered via Cloudwatch event. 💡 The Codebuild could also be deployed in a central mangement account and just assumes a role in the target account. &lt;/p&gt;

&lt;h2&gt;
  
  
  9. Data lifecycle management
&lt;/h2&gt;

&lt;p&gt;Defining a lifecycle for your data will help you lower the operational costs without losing and reduce the complexity of managing your backup operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.1 Development accounts
&lt;/h2&gt;

&lt;p&gt;Since development accounts should not contain any production data its very easy to define a lifecycle for all data in development accounts. I would suggest to decide a specific timerange after all data will be deleted regularly.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.2 Production accounts
&lt;/h2&gt;

&lt;p&gt;The decision for production accounts is a little more difficult than for development accounts, but it is also feasible. Here you only have to decide how long you need, which data to restore the application in the event of an error and which log files are needed for how long. Whether it is data on S3, instance snapshots or log files on CloudWatch, all services support mechanisms that either delete the data or move it to cheaper storage after a certain period of time. In the case of log files, I would prefer to keep the data in their place for a longer time than too short. Especially if there are holidays in between and you want to analyze an error and the data is then no longer there, that's bad 😉. Below you can find some posts regarding backup handling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/mt/automate-aws-backups-with-aws-service-catalog/"&gt;Automate AWS Backups with AWS Service Catalog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/storage/automating-amazon-ebs-snapshots-management-using-data-lifecycle-manager/"&gt;Automating Amazon EBS snapshots management using Data Lifecycle Manager&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/database/building-data-lakes-and-implementing-data-retention-policies-with-amazon-rds-snapshot-export-to-amazon-s3/"&gt;Building data lakes and implementing data retention policies with Amazon RDS snapshot export to Amazon S3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  10. Tagging
&lt;/h2&gt;

&lt;p&gt;Tagging of resources is one of the most important things when it comes to accounts - it helps you to identity who created resources, who is responsible for them, how costs should be allocated and even with lifecycle policies. Therefore you should tag every resource to simplify administration. If you want to learn more about Tagging read the following whtepaper: &lt;a href="https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf"&gt;Tagging Best Practices&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Network connectivity
&lt;/h2&gt;

&lt;p&gt;If you ask me: the topic of network connectivity could be completely eliminated nowadays, as the first motto should be API first and applications should only talk to each other via secure APIs, but there are still applications today that do not have corresponding APIs whicb have large amounts of data to be transferred or certain regulations ensure that communication has to take place via dedicated connections. So how to handle them? In organizations where you need dedicated connections or every other VPN connectivity to on-prem, I would choose the Transit Gateway. Transit Gateway connects VPCs and on-premise networks through a central hub. You can create datadomains to restrict and control your complete dataflow of your organization on one hand and on the other hand you expand globally with inter-region peering. Plus your data is automatically encrypted and never travels over the public internet.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>governance</category>
      <category>security</category>
    </item>
    <item>
      <title>Account Factory - provision AWS Accounts</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 30 May 2022 07:31:20 +0000</pubDate>
      <link>https://community.ops.io/daknhh/account-factory-provision-aws-accounts-17pd</link>
      <guid>https://community.ops.io/daknhh/account-factory-provision-aws-accounts-17pd</guid>
      <description>&lt;p&gt;Best Practice for creating AWS Accounts&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/xtv00_EkCqtPap0h2CKAFouZEOIZDgDXr_L6whwU1og/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMveWQ4/dzc2N2ozY2J3bWcy/bzI3Y3gucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/xtv00_EkCqtPap0h2CKAFouZEOIZDgDXr_L6whwU1og/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMveWQ4/dzc2N2ozY2J3bWcy/bzI3Y3gucG5n" alt="" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  What is an Account Factory?
&lt;/h2&gt;

&lt;p&gt;The Account Factory is a solution to manage account creation and bootstrapping in a scalable and efficient manner so that new accounts are created with a defined baseline and governance guardrails are in place. If you want to get your hands dirty with an Account Factory - you can take a look at this &lt;a href="https://controltower.aws-management.tools/core/accountfactory/"&gt;workshop&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should I use a Account Factory?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;⚙️ Equivalent process for every account&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💸 Save time and resources&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔐 Secure and well-architected accounts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📜 Documented process&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔌 Native integration to your ticket system like &lt;a href="https://support.atlassian.com/jira-service-management-cloud/docs/connect-jira-service-management-cloud-to-aws-service-catalog/"&gt;Jira&lt;/a&gt; - &lt;a href="https://docs.aws.amazon.com/servicecatalog/latest/adminguide/config-sn.html"&gt;ServiceNow&lt;/a&gt;; this means that internal approval processes can be used to trigger the Account provisioning&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🚀 Ready to use accounts in minutes&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What solutions are outside for account provisioning?
&lt;/h2&gt;

&lt;p&gt;If you use the Control Tower for your Landing Zone it's coming already with an &lt;a href="https://docs.aws.amazon.com/controltower/latest/userguide/account-factory.html"&gt;Account Factory&lt;/a&gt; - there's also already existent solutions to &lt;a href="https://aws.amazon.com/de/solutions/implementations/customizations-for-aws-control-tower/"&gt;customize&lt;/a&gt; the Account Factory to your needs. Even if you use the official landing zone solution there are some examples of &lt;a href="https://github.com/aws-samples/aws-account-vending-machine"&gt;Account vending machines&lt;/a&gt; on github.&lt;/p&gt;

&lt;h2&gt;
  
  
  What steps are part of an account factory?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Creation of a new AWS Account - the first part of the Account Factory is to provision a new Account, the solution is using the &lt;a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_CreateAccount.html"&gt;organizations API&lt;/a&gt; for that.
💡 Activate &lt;a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_CreateAccount.html#organizations-CreateAccount-request-IamUserAccessToBilling"&gt;IamUserAccessToBilling&lt;/a&gt; - othwerwise only the root user of the new account can access account billing information.&lt;/li&gt;
&lt;/ol&gt;



&lt;ol&gt;
&lt;li&gt;Deploy the baseline template to new AWS Accounts - regardless of whether you want to provide resources via API / CDK, StackSets or CodePipeline, you need a role that you can assume in the new account, so we need an AccountBaseline that includes a role with trust for the management or automation account.&lt;/li&gt;
&lt;/ol&gt;



&lt;ol&gt;
&lt;li&gt;Remove default VPC - A default VPC is suitable for getting started quickly - not for production workloads. &lt;/li&gt;
&lt;/ol&gt;



&lt;ol&gt;
&lt;li&gt;Deploy security baseline and other customized ressources - this step includes eg.: the activation of GuardDuty, Config, CloudTrail - if you dont use the &lt;a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html"&gt;Organizational Trail&lt;/a&gt;, creation of own VPC, security notification service etc.
You can use StackSets or CodePipeline for that. It would make sense to separate the configuration which stacks /resources  you want to activate  from the actual Account Factory. 
💡 You can for example use SSM Parameter Store for that - You could also think of using different configs for services , which are deployed in to new accounts or not depending on the selection in the Account Factory. &lt;/li&gt;
&lt;/ol&gt;



&lt;ol&gt;
&lt;li&gt;Optional: 

&lt;ul&gt;
&lt;li&gt;Use support case API to activate enterprise Account in the new Account.&lt;/li&gt;
&lt;li&gt;Activate root MFA automatically.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;



&lt;ol&gt;
&lt;li&gt;Move new Account to desired organizional unit. According to best practices, it is recommend to structure your accounts in an organization and assign scps to organizational units. Since SCPs can cause problems when providing a new account, I recommend to move the new accounts at the end of the Account Factory to the corresponding unit.
&lt;/li&gt;
&lt;/ol&gt;



&lt;ol&gt;
&lt;li&gt;Send status mail or slack / teams message. In order to get a status overview of the new Account,  you should think of collecting information while the Account Factory is running and send them as a message to the new Account owner or governance at scale team. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/MXFaUTEZ3WqV5JN7s1mGoQAMZjeS4Ps7rsgvCRm9HiY/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvOXEz/amNqMzFiOThoYzcy/ZG0yYjEucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/MXFaUTEZ3WqV5JN7s1mGoQAMZjeS4Ps7rsgvCRm9HiY/w:880/mb:500000/ar:1/aHR0cHM6Ly9kZXYt/dG8tdXBsb2Fkcy5z/My5hbWF6b25hd3Mu/Y29tL3VwbG9hZHMv/YXJ0aWNsZXMvOXEz/amNqMzFiOThoYzcy/ZG0yYjEucG5n" alt="Account Factory Example Architecture" width="800" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>governance</category>
      <category>security</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
