git: 242d1c32e42c - stable/13 - Add support for recording EC2 AMI Ids in SSM

Colin Percival cperciva at FreeBSD.org
Sat Sep 11 01:30:35 UTC 2021


The branch stable/13 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=242d1c32e42cac4edf8922b339793573ed045540

commit 242d1c32e42cac4edf8922b339793573ed045540
Author:     Colin Percival <cperciva at FreeBSD.org>
AuthorDate: 2021-08-27 00:54:53 +0000
Commit:     Colin Percival <cperciva at FreeBSD.org>
CommitDate: 2021-09-11 01:30:19 +0000

    Add support for recording EC2 AMI Ids in SSM
    
    If SSMPREFIX is specified, AMI Ids will be recorded in the SSM
    Parameter Store under the name
      ${SSMPREFIX}/${ARCH}/${FLAVOUR}/${ROOTFS}/${REVISION}/${BRANCH}
    where ARCH is "amd64" or "arm64", FLAVOUR is "base" (but may have
    other options in the future), ROOTFS is "ufs" (but may have other
    options in the future), and REVISION and BRANCH have their normal
    meanings.
    
    FreeBSD will be using the public prefix "/aws/service/freebsd",
    resulting in SSM Parameter names which look like
      /aws/service/freebsd/amd64/base/ufs/14.0/CURRENT
    
    Relnotes:       yes
    Sponsored by:   https://patreon.com/cperciva
    MFC after:      2 weeks
    
    (cherry picked from commit c5af0ac1a732491aab789dda0da368ff48497871)
---
 release/Makefile.ec2 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/release/Makefile.ec2 b/release/Makefile.ec2
index 63552494db95..58042cba1f88 100644
--- a/release/Makefile.ec2
+++ b/release/Makefile.ec2
@@ -18,6 +18,9 @@ PUBLICSNAP=	--publicsnap
 EC2SNSREL=	${REVISION}-${BRANCH}
 EC2SNSVERS=	${GITBRANCH}@${GITREV}
 .endif
+.if defined(SSMPREFIX) && !empty(SSMPREFIX)
+SSMOPTS=	--ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/ufs/${REVISION}/${BRANCH}
+.endif
 .if ${TARGET_ARCH} != "amd64"
 EC2ARCH=	--${TARGET_ARCH:S/aarch64/arm64/}
 .endif
@@ -62,7 +65,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
 	@false
 .endif
 	/usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \
-	    ${EC2ARCH} --sriov --ena \
+	    ${EC2ARCH} ${SSMOPTS} --sriov --ena \
 	    ${.OBJDIR}/ec2.raw \
 	    "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
 	    "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \


More information about the dev-commits-src-branches mailing list