sysutils/awslim: New port

awslim is a CLI utility for AWS services.  This is written in Go and
generated from the AWS SDK Go v2 service client.  Features include:

 - Improved performance compared to AWS CLI,
 - All methods of the AWS service client,
 - JSON and Jsonnet as input format,
 - JSON as output format (no support of TEXT),
 - Binding of a file to the input/output data structure of methods,
 - JMESPath to query the output,
 - AWS CLI configuration file (~/.aws/config) and the native
   configuration files (~/.config/awslim/config.(json|jsonnet|yaml|yml)).

Approved by:	hrs (mentor)
This commit is contained in:
Norikatsu Shigemura
2025-06-15 15:21:03 +09:00
parent e35fe10395
commit 29ce0be017
7 changed files with 142 additions and 0 deletions
+1
View File
@@ -75,6 +75,7 @@
SUBDIR += autojump
SUBDIR += automounter
SUBDIR += autorestic
SUBDIR += awslim
SUBDIR += azure-agent
SUBDIR += b2sum
SUBDIR += b3sum
+51
View File
@@ -0,0 +1,51 @@
PORTNAME= awslim
DISTVERSIONPREFIX= v
DISTVERSION= 0.4.0
CATEGORIES= sysutils
MAINTAINER= nork@FreeBSD.org
COMMENT= AWSCLi slim version for ${COMMENT_${FLAVOR}}
WWW= https://github.com/fujiwara/awslim
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
FLAVORS= default compact
FLAVOR?= ${FLAVORS:[1]}
compact_PKGNAMESUFFIX= -compact
USES= go:modules
USE_GITHUB= yes
GH_ACCOUNT= fujiwara
GH_TUPLE= alecthomas:kong:v1.10.0:alecthomas_kong/vendor/github.com/alecthomas/kong \
aws:aws-sdk-go-v2:v1.36.3:aws_aws_sdk_go/vendor/github.com/aws/aws-sdk-go-v2 \
aws:smithy-go:v1.22.2:aws_smithy_go/vendor/github.com/aws/smithy-go \
go-yaml:yaml:v2.2.8:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \
goccy:go-yaml:v1.17.1:go_yaml/vendor/github.com/goccy/go-yaml \
google:go-jsonnet:v0.20.0:google_go_jsonnet/vendor/github.com/google/go-jsonnet \
kubernetes-sigs:yaml:v1.1.0:kubernetes_sigs_yaml/vendor/sigs.k8s.io/yaml \
jmespath:go-jmespath:v0.4.0:jmespath_go_jmespath/vendor/github.com/jmespath/go-jmespath \
mattn:go-shellwords:v1.0.12:mattn_go_shellwords/vendor/github.com/mattn/go-shellwords
GO_ENV+= GO_CMD="${GO_CMD}"
GO_TARGET= ./cmd/awslim/main.go:awslim
GO_BUILDFLAGS= -tags netgo -ldflags "-s -w -extldflags "-static" -X github.com/fujiwara/awslim.Version=${DISTVERSION}"
PLIST_FILES= bin/awslim
COMMENT_default= all services
COMMENT_compact= selected services
.if ${FLAVOR:U} == compact
post-extract:
${LN} -sf ${FILESDIR}/compact-gen.yaml ${WRKSRC}/gen.yaml
.else
post-extract:
${LN} -sf all-services.yaml ${WRKSRC}/gen.yaml
.endif
pre-build:
cd ${GO_WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} GOMAXPROCS=${MAKE_JOBS_NUMBER} GOPROXY=off ${GO_CMD} generate ${GO_BUILDFLAGS} ./cmd/awslim-gen .
.include <bsd.port.mk>
+21
View File
@@ -0,0 +1,21 @@
TIMESTAMP = 1749690287
SHA256 (fujiwara-awslim-v0.4.0_GH0.tar.gz) = e08bc0b480d4297a1ceb6d669ed6fe12e84ef3af9ed54cf1ffdb475384935a61
SIZE (fujiwara-awslim-v0.4.0_GH0.tar.gz) = 26656
SHA256 (alecthomas-kong-v1.10.0_GH0.tar.gz) = a1a8abba946101394cbf15c2f449052b65cca2526169bd7eb3d79f57e2a94e8d
SIZE (alecthomas-kong-v1.10.0_GH0.tar.gz) = 322112
SHA256 (aws-aws-sdk-go-v2-v1.36.3_GH0.tar.gz) = 9f15888c55acccd592664427c0ac18318130a7990852fbd288ab7f7ec4f2e8a7
SIZE (aws-aws-sdk-go-v2-v1.36.3_GH0.tar.gz) = 51861411
SHA256 (aws-smithy-go-v1.22.2_GH0.tar.gz) = aa4185416c44ecd1cbd30a07398c664a293e22874c38ac8738d95a3b717232f0
SIZE (aws-smithy-go-v1.22.2_GH0.tar.gz) = 471066
SHA256 (go-yaml-yaml-v2.2.8_GH0.tar.gz) = 9632d0760e9a07c414f2b2b6cd453d6225e42ecea77906883b23f1f1d0546045
SIZE (go-yaml-yaml-v2.2.8_GH0.tar.gz) = 72732
SHA256 (goccy-go-yaml-v1.17.1_GH0.tar.gz) = 112fdb40aa102a258bed581ae4b230b330d80b186b0b6953ec58c69a61bd3dbd
SIZE (goccy-go-yaml-v1.17.1_GH0.tar.gz) = 663082
SHA256 (google-go-jsonnet-v0.20.0_GH0.tar.gz) = bf9923a848dba65fa99f6e926221ab4222c2f259ba837d279b43917962bc7d70
SIZE (google-go-jsonnet-v0.20.0_GH0.tar.gz) = 705146
SHA256 (kubernetes-sigs-yaml-v1.1.0_GH0.tar.gz) = 0ee3cfa6e0c3178df07213443ebac0d6ecc1178147f43f848ea7114acf621953
SIZE (kubernetes-sigs-yaml-v1.1.0_GH0.tar.gz) = 14890
SHA256 (jmespath-go-jmespath-v0.4.0_GH0.tar.gz) = aa86d00b6836345eee196c13df2df084a18e0b1159935de9289f2ef6a7fe375d
SIZE (jmespath-go-jmespath-v0.4.0_GH0.tar.gz) = 128861
SHA256 (mattn-go-shellwords-v1.0.12_GH0.tar.gz) = 9884291747f54aa51a946b0880854ec6ac6e1f4c06899ba9be5ae5a6364428db
SIZE (mattn-go-shellwords-v1.0.12_GH0.tar.gz) = 6325
+22
View File
@@ -0,0 +1,22 @@
services:
cloudformation:
cloudfront:
cloudfrontkeyvaluestore:
cloudwatch:
cloudwatchevents:
cloudwatchlogs:
ebs:
ec2:
eventbridge:
iam:
kms:
lambda:
rds:
route53:
s3:
secretsmanager:
servicequotas:
ssm:
sso:
ssoadmin:
sts:
@@ -0,0 +1,18 @@
--- all-services.yaml.orig 2025-04-11 13:35:01 UTC
+++ all-services.yaml
@@ -156,7 +156,6 @@ services:
freetier:
fsx:
gamelift:
- gameliftstreams:
geomaps:
geoplaces:
georoutes:
@@ -187,7 +186,6 @@ services:
iotfleethub:
iotfleetwise:
iotjobsdataplane:
- iotmanagedintegrations:
iotsecuretunneling:
iotsitewise:
iotthingsgraph:
@@ -0,0 +1,12 @@
--- cmd/awslim-gen/main.go.orig 2025-04-11 13:35:01 UTC
+++ cmd/awslim-gen/main.go
@@ -10,8 +10,7 @@ import (
"text/template"
)
-//go:generate go run ../awslim-gen-gen/main.go
-//go:generate go get ./...
+//go:generate ${GO_CMD} run ../awslim-gen-gen/main.go
const serviceTemplateStr = `// Code generated by cmd/awslim-gen/main.go; DO NOT EDIT.
package sdkclient
+17
View File
@@ -0,0 +1,17 @@
awslim is a CLI utility for AWS services. This is written in Go and
generated from the AWS SDK Go v2 service client. Features include:
- Improved performance compared to AWS CLI,
- All methods of the AWS service client,
- JSON and Jsonnet as input format,
- JSON as output format (no support of TEXT),
- Binding of a file to the input/output data structure of methods,
- JMESPath to query the output,
- AWS CLI configuration file (~/.aws/config) and the native
configuration files (~/.config/awslim/config.(json|jsonnet|yaml|yml)).
Note the following limitations, compared to AWS CLI:
- Not fully-compatible with the AWS CLI,
- No support of AWS CLI plugins, such as session-manager-plugin,
- Different service names, "logs" vs "cloudwatchlogs,"
"ce" vs "costexplorer," for example.