Giter Site home page Giter Site logo

karldthomas / service-catalog-cloud9 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/service-catalog-cloud9

0.0 0.0 0.0 1.09 MB

Works around issues with using AWS Cloud9 and Service Catalog

License: MIT No Attribution

Shell 45.22% Python 54.78%

service-catalog-cloud9's Introduction

AWS Service Catalog Cloud9 Deployment

This repository consists of a framework to deploy AWS Cloud 9 with AWS Service Catalog.

There are unique challenges with deploying Cloud 9 environments using Service Catalog. When you provision Cloud 9 environments directly within the AWS Console or with AWS CloudFormation, the environment is assigned to the logged in user's account and is only accessible by that user.

When deploying a Cloud 9 environment via Service Catalog, by default, the Cloud 9 environment is assigned to a Service Catalog service role that is inaccessible to the user. This solution works around that issue by capturing the user who launched the product by storing the relevant AWS CloudTrail event and assigning the user to the Cloud 9 environment.

You also cannot specify the size of the underlying storage with CloudFormation. This repository also includes a CloudFormation custom resource which modifies the size of the attached Elastic Block Store volume and allows the end user to specify the amount of storage needed for the Cloud 9 environment. By default, Cloud 9 only allocates 10GB of storage.

What is AWS Service Catalog?

AWS Service Catalog lets you centrally manage your cloud resources to achieve governance at scale of your infrastructure as code (IaC) templates, written in CloudFormation or Terraform. With AWS Service Catalog, you can meet your compliance requirements while making sure your customers can quickly deploy the cloud resources they need.

What is AWS Cloud 9?

AWS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser. It includes a code editor, debugger, and terminal. Cloud9 comes prepackaged with essential tools for popular programming languages, including JavaScript, Python, PHP, and more, so you don’t need to install files or configure your development machine to start new projects.

Architecture

Cloud9

Assigning the Cloud 9 environment to the logged in user

The architecture is based on the AWS blogpost Tracking AWS Service Catalog products provisioned by individual SAML users.

  1. The user provisions the AWS Cloud 9 product after authenticating to AWS Service Catalog.
  2. AWS Service Catalog launches an AWS CloudFormation template in response to the user’s request.
  3. An AWS Lambda function (lmd-csr-store-cft-deployer) is invoked based on the Amazon CloudWatch rule triggered by the CloudFormation CreateStack event.
  4. lmd-csr-store-cft-deployerfunction reads the Active Directory User Name and CloudFormation stack ID from the event record and stores this information in an Amazon DynamoDB database (sc-track-user).
  5. The CloudFormation template provisions a custom resource that invokes the AWS Lambda function (lmd-csr-get-cft-deployer).
  6. The Lambda function reads the user name from the Amazon DynamoDB record associated with the CloudFormation stack ID and returns this information back to the CloudFormation template.

Deployed Resources

This repository is based on the Service Catalog Framework.

It also includes Lambdas from the CloudFormation data sources repository

Prerequisites

Tagging VPCs and Subnets

This solution uses two CloudFormation custom resources to determine where the Cloud 9 EC2 instance should be deployed based on tags:

Deployment

Using AWS CloudShell

The most straightforward method to deploy this solution involves logging into your AWS account with the appropriate permissions and using AWS CloudShell

Log into your AWS account, navigate to the Cloudshell page and clone the repository.

# Deploy the Lambdas
bash deploy.sh

Deploying locally

Prerequisites

  • AWS SAM prerequisites
  • Docker Desktop When deploying locally instead of using CloudShell, the deployment script uses Docker to build the Lambdas with the proper dependencies.

From the terminal, after you clone the repository, run the following commands.

# Deploy the Lambdas
bash deploy.sh

Framework Documentation

service-catalog-cloud9's People

Contributors

amazon-auto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.