{"id":15546843,"url":"https://github.com/tupyy/aws-lua","last_synced_at":"2025-03-29T01:18:25.956Z","repository":{"id":192003470,"uuid":"685853863","full_name":"tupyy/aws-lua","owner":"tupyy","description":"Small poc which allows creation of aws resources from lua","archived":false,"fork":false,"pushed_at":"2023-09-01T07:00:51.000Z","size":3049,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T11:14:11.360Z","etag":null,"topics":["aws","golang","lua","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tupyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-01T06:53:28.000Z","updated_at":"2023-09-01T07:01:22.000Z","dependencies_parsed_at":"2023-09-02T00:25:11.394Z","dependency_job_id":"6c985f67-0466-4875-bb18-97a2d48350f6","html_url":"https://github.com/tupyy/aws-lua","commit_stats":null,"previous_names":["tupyy/aws-lua"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tupyy%2Faws-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tupyy%2Faws-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tupyy%2Faws-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tupyy%2Faws-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tupyy","download_url":"https://codeload.github.com/tupyy/aws-lua/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246122392,"owners_count":20726823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","golang","lua","terraform"],"created_at":"2024-10-02T13:05:03.087Z","updated_at":"2025-03-29T01:18:25.932Z","avatar_url":"https://github.com/tupyy.png","language":"Go","readme":"## aws-lua\n\nThis small poc creates aws resources from lua.\n\nFor example, the following script list all vpc and look for a vpc with the tag `myvpc=true`. \nIf such a vpc is not found, it will create one:\n```lua\nlocal aws = require(\"aws\")\n-- Look for a VPC with the tag myvpc=true.\n-- If not found create one with cidr=10.0.0.0/16\n\n-- create vpc\nlocal function create_vpc(cidr, tags)\n    vpc = {\n        cidr = cidr,\n    }\n    if tags ~= nil and type(tags) == \"table\" then\n        vpc[\"tags\"] = tags\n    end\n    return aws.create(\"aws_vpc\", vpc)\nend\n\n-- Get VPCs\nlocal vpcs, err = aws.list(\"aws_vpc\", {})\nif err ~= nil then\n    print(err)\n    os.exit(1)\nend\n\nlocal vpc = { found = false }\nif vpcs ~= nil then\n    for _, _vpc in pairs(vpcs.Vpcs) do\n        if _vpc.Tags ~= nil then\n            for _, v in pairs(_vpc.Tags) do\n                if v.Key == \"myvpc\" and v.Value == \"true\" then\n                    vpc.found = true\n                    vpc.id = _vpc.VpcId\n                end\n            end\n        end\n    end\nend\n\nlocal vpc_id\nif vpc.found then\n    print(\"myvpc VPC found. ID: \" .. vpc.id)\n    vpc_id = vpc.id\nelse\n    local vpc, err = create_vpc(\"10.0.0.0/16\", { myvpc = \"true\" })\n    if err ~= nil then\n        print(\"vpc creation failed: \" .. err)\n        os.exit(1)\n    end\n    if vpc ~= nil then\n        print(\"vpc created: \" .. vpc.Vpc.VpcId)\n        vpc_id = vpc.Vpc.VpcId\n    end\nend\n```\n\n### Use\n```shell\nmake build\nbin/aws-lua -f path_to_lua_script --aws-access-key \u003caccess-key\u003e --aws-secret-key \u003csecret-key\u003e --aws-region \u003caws-region\u003e\n```\n### Current supported AWS API:\n\n- DescribeAvailabilityZones\n- CreateVpc\n- DescribeVpcs\n- CreateSubnet\n- DescribeSubnets\n- CreateUser\n- ListUsers\n- CreateAccessKey\n- ListAccessKeys\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftupyy%2Faws-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftupyy%2Faws-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftupyy%2Faws-lua/lists"}