Điểm qua cloudtools/troposphere: 4.9k sao trên GitHub, viết chủ yếu bằng Python, thuộc nhóm Backend. troposphere - Python library to create AWS CloudFormation descriptions
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
.. image:: https://img.shields.io/pypi/v/troposphere.svg
:target: https://pypi.python.org/pypi/troposphere
:alt: PyPI Version
.. image:: https://github.com/cloudtools/troposphere/actions/workflows/tests.yml/badge.svg
:target: https://github.com/cloudtools/troposphere/actions?query=branch%3Amain
:alt: Build Status
.. image:: https://img.shields.io/pypi/l/troposphere.svg
:target: https://opensource.org/licenses/BSD-2-Clause
:alt: license: New BSD license
.. image:: https://readthedocs.org/projects/troposphere/badge/?version=latest
:target: https://troposphere.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
About
troposphere - library to create AWS CloudFormation_ descriptions
The troposphere library allows for easier creation of the AWS CloudFormation JSON_ by writing Python code to describe the AWS resources. troposphere also
includes some basic support for OpenStack resources_ via Heat.
To facilitate catching CloudFormation or JSON errors early the library has
property and type checking built into the classes.
Installation
troposphere can be installed using the pip distribution system for Python by
issuing:
.. code:: sh
$ pip install troposphere
To install troposphere with awacs <https://github.com/cloudtools/awacs>_
(recommended soft dependency):
.. code:: sh
$ pip install troposphere[policy]
Alternatively, you can use setup.py to install by cloning this repository
and issuing:
.. code:: sh
$ python setup.py install # you may need sudo depending on your python installation
Examples
A simple example to create an instance would look like this:
>>> from troposphere import Template
>>> import troposphere.ec2 as ec2
>>> t = Template()
>>> t.add_resource(ec2.Subnet("ec2subnet", VpcId="vpcid"))
<troposphere.ec2.Subnet object at 0x100830ed0>
>>> print(t.to_json())
Traceback (most recent call last):
...
ValueError: Resource CidrBlock required in type AWS::EC2::Subnet (title: ec2subnet)
Currently supported resource types
AWS Resource Types_
OpenStack Resource Types_
Duplicating a single instance sample would look like this
.. code:: python
# Converted from EC2InstanceSample.template located at:
# http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
from troposphere import Base64, FindInMap, GetAtt
from troposphere import Parameter, Output, Ref, Template
import troposphere.ec2 as ec2
template = Template()
keyname_param = template.add_parameter(Parameter(
"KeyName",
Description="Name of an existing EC2 KeyPair to enable SSH "
"access to the instance",
Type="String",
))
template.add_mapping('RegionMap', {
"us-east-1": {"AMI": "ami-7f418316"},
"us-west-1": {"AMI": "ami-951945d0"},
"us-west-2": {"AMI": "ami-16fd7026"},
"eu-west-1": {"AMI": "ami-24506250"},
"sa-east-1": {"AMI": "ami-3e3be423"},
"ap-southeast-1": {"AMI": "ami-74dda626"},
"ap-northeast-1": {"AMI": "ami-dcfa4edd"}
})
ec2_instance = template.add_resource(ec2.Instance(
"Ec2Instance",
ImageId=FindInMap("RegionMap", Ref("AWS::Region"), "AMI"),
InstanceType="t1.micro",
KeyName=Ref(keyname_param),
SecurityGroups=["default"],
UserData=Base64("80")
))
template.add_output([
Output(
"InstanceId",
Description="InstanceId of the newly created EC2 instance",
Value=Ref(ec2_instance),
),
Output(
"AZ",
Description="Availability Zone of the newly created EC2 instance",
Value=GetAtt(ec2_instance, "AvailabilityZone"),
),
Output(
"PublicIP",
Description="Public IP address of the newly created EC2 instance",
Value=GetAtt(ec2_instance, "PublicIp"),
),
Output(
"PrivateIP",
Description="Private IP address of the newly created EC2 instance",
Value=GetAtt(ec2_instance, "PrivateIp"),
),
Output(
"PublicDNS",
Description="Public DNSName of the newly created EC2 instance",
Value=GetAtt(ec2_instance, "PublicDnsName"),
),
Output(
"PrivateDNS",
Description="Private DNSName of the newly created EC2 instance",
Value=GetAtt(ec2_instance, "PrivateDnsName"),
),
])
print(template.to_json())
Community
We have a Google Group, cloudtools-dev_, where you can ask questions and
engage with the troposphere community. Issues and pull requests are always
welcome!
Licensing
troposphere is licensed under the BSD 2-Clause license.
See LICENSE for the troposphere full license text.
Có — cloudtools/troposphere phát hành theo license BSD-2-Clause, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/cloudtools/troposphere.
cloudtools/troposphere là gì?
cloudtools/troposphere (cloudtools/troposphere) là dự án Python trên GitHub. Theo mô tả gốc: troposphere - Python library to create AWS CloudFormation descriptions
cloudtools/troposphere so với các dự án Backend khác thế nào?
cloudtools/troposphere được TopGit xếp vào nhóm Backend, với 4.9k sao GitHub và viết bằng Python. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Cùng nhóm Backend còn repo nào?
cloudtools/troposphere thuộc nhóm Backend trên TopGit, cùng 5 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về cloudtools/troposphere ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/cloudtools/troposphere là nguồn chính thức.
Vì sao cloudtools/troposphere được xếp vào nhóm Backend?
TopGit xếp cloudtools/troposphere vào nhóm Backend dựa trên GitHub topics và mô tả của repo (gắn thẻ: "aws-cloudformation", "cloudformation", "python"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về troposphere?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về troposphere.