Skip to content
No description or website provided.
Python Other
  1. Python 99.1%
  2. Other 0.9%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.devcontainer chore: update vscode devcontainer python version Aug 3, 2019
.vscode Batman! (this commit has no parents) Jul 24, 2019
src/iccli chore: update aws cfn resource spec to v5.0.0 Aug 3, 2019
.coveragerc Batman! (this commit has no parents) Jul 24, 2019
.editorconfig
.gitattributes Batman! (this commit has no parents) Jul 24, 2019
.gitignore Batman! (this commit has no parents) Jul 24, 2019
.pylintrc Batman! (this commit has no parents) Jul 24, 2019
LICENSE Batman! (this commit has no parents) Jul 24, 2019
MANIFEST.in Batman! (this commit has no parents) Jul 24, 2019
Makefile Batman! (this commit has no parents) Jul 24, 2019
README.md docs: add link to slack channel Jul 26, 2019
mypy.ini Batman! (this commit has no parents) Jul 24, 2019
pytest.ini Batman! (this commit has no parents) Jul 24, 2019
setup.cfg Batman! (this commit has no parents) Jul 24, 2019
setup.py chore(release): v0.2.0 Aug 3, 2019

README.md

IC

Bricks and mortar for ☁️ developers.

The IC project combines a language, a public index, and a set of tools to empower every developer to create composable cloud-native infrastructures, share, and collaborate, irrespective of cloud providers.

General Information

Glimpse

Syntax

Let's create a simple web server.

from ic import aws, awsutil


USER_DATA = """#!/usr/bin/env bash
echo "Hello, World!" > index.html
nohup python -m SimpleHTTPServer 80 &"""


@resource
def brick():
    security_group = aws.ec2.security_group(
        "security_group",
        group_description="Enable HTTP access via port 80",
        security_group_ingress=[
            dict(cidr_ip="0.0.0.0/0", from_port=80, to_port=80, ip_protocol="tcp")
        ],
    )
    instance = aws.ec2.instance(
        "instance",
        instance_type="t2.micro",
        image_id="ami-0cc96feef8c6bbff3",
        security_groups=[security_group["ref"]],
        user_data=awsutil.b64encode(USER_DATA),
    )
    return f"http://{instance['public_ip']}"

What happened?

  • L9: we create a new IC resource, a virtual unit of infrastructure
  • L11 & L18: we create two native AWS specific resources
  • L22: we reference a previously created resource
  • L23: we use an AWS specific function provided by the IC Standard Library imported at L1
  • L25: we return a formatted string with a dynamic attribute as the value of our resource

Community

Above, we did all the hard work by ourselves 😅. However, maybe someone in the community has already taken this effort.

$ ic search hello world
──────────────────────────────────────────────────────────────────────
fsenart.hello_world
My first IC brick

MIT • v0.2.0 • 42 days ago
──────────────────────────────────────────────────────────────────────

Luckily, fsenart has already made if for us 😍 ! Let's not reinvent the wheel and deploy it right from the IC Public Index.

$ ic aws up fsenart.hello_world demo

That's it! We can now retrieve the dynamic value returned by our resource to access the web server.

$ ic aws value demo
"http://1.2.3.4"

Beyond

Finally, let's customize the brick we've found earlier.

from fsenart import hello_world

@resource
def brick():
    return hello_world.brick("hello_me", message="Hello, Me!")

And share it with the community.

$ ic publish

Copyright and License

Copyright 2019 Farzad Senart and Lionel Suss. All rights reserved.

Unless otherwise stated, the source code is licensed under the GNU Affero General Public License Version 3 (AGPLv3).

If you use IC to create your infrastructure, then your source code DOES NOT need to be licensed under GPL.

The IC Standard Library (the only API between your source code and the AGPL licensed IC source code) is licensed under the Apache License Version 2.

Unless otherwise stated, the documentation is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.

You can’t perform that action at this time.