Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update more templates to used dictionary literals #824

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions azure-python/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
account = storage.StorageAccount(
"sa",
resource_group_name=resource_group.name,
sku=storage.SkuArgs(
name=storage.SkuName.STANDARD_LRS,
),
sku={
"name": storage.SkuName.STANDARD_LRS,
},
kind=storage.Kind.STORAGE_V2,
)

Expand Down
24 changes: 12 additions & 12 deletions civo-python/__main__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import pulumi
import pulumi_civo as civo

firewall = civo.Firewall("civo-firewall",
create_default_rules=True,
region='LON1')
firewall = civo.Firewall("civo-firewall", create_default_rules=True, region="LON1")

cluster = civo.KubernetesCluster('civo-k3s-cluster',
name='myFirstCivoCluster',
region='LON1',
firewall_id=firewall.id,
pools=civo.KubernetesClusterPoolsArgs(
node_count=3,
size="g4s.kube.medium",
))
cluster = civo.KubernetesCluster(
"civo-k3s-cluster",
name="myFirstCivoCluster",
region="LON1",
firewall_id=firewall.id,
pools={
"node_count": 3,
"size": "g4s.kube.medium",
},
)

pulumi.export('cluster_name', cluster.name)
pulumi.export("cluster_name", cluster.name)
4 changes: 2 additions & 2 deletions civo-python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pulumi==3.60.0
pulumi-civo==2.3.4
pulumi>=3.0.0,<4.0.0
pulumi-civo>=2,<3
39 changes: 19 additions & 20 deletions container-aws-python/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,34 @@
loadbalancer = awsx.lb.ApplicationLoadBalancer("loadbalancer")

# An ECR repository to store our application's container image
repo = awsx.ecr.Repository("repo", awsx.ecr.RepositoryArgs(
force_delete=True,
))
repo = awsx.ecr.Repository("repo", force_delete=True)

# Build and publish our application's container image from ./app to the ECR repository
image = awsx.ecr.Image(
"image",
repository_url=repo.url,
context="./app",
platform="linux/amd64")
"image", repository_url=repo.url, context="./app", platform="linux/amd64"
)

# Deploy an ECS Service on Fargate to host the application container
service = awsx.ecs.FargateService(
"service",
cluster=cluster.arn,
assign_public_ip=True,
task_definition_args=awsx.ecs.FargateServiceTaskDefinitionArgs(
container=awsx.ecs.TaskDefinitionContainerDefinitionArgs(
name="app",
image=image.image_uri,
cpu=cpu,
memory=memory,
essential=True,
port_mappings=[awsx.ecs.TaskDefinitionPortMappingArgs(
container_port=container_port,
target_group=loadbalancer.default_target_group,
)],
),
))
task_definition_args={
"container": {
"name": "app",
"image": image.image_uri,
"cpu": cpu,
"memory": memory,
"essential": True,
"port_mappings": [
{
"container_port": container_port,
"target_group": loadbalancer.default_target_group,
}
],
},
},
)

# The URL at which the container's HTTP endpoint will be available
export("url", Output.concat("http://", loadbalancer.load_balancer.dns_name))
Loading