Skip to content

Commit

Permalink
release: set AWS_SDK_LOAD_CONFIG for system services
Browse files Browse the repository at this point in the history
The AWS SDK for Go doesn't use the ${HOME}/.aws/config file unless
the AWS_SDK_LOAD_CONFIG env variable is set to a truthy value

Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
  • Loading branch information
arnaldo2792 committed Nov 6, 2024
1 parent da6e9c5 commit 7cd4cd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/release/aws-config.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Service]
# Set the AWS_SDK_LOAD_CONFIG system-wide instead of at the individual service
# level, to make sure new system services that use the AWS SDK for Go read the
# shared AWS config
Environment=AWS_SDK_LOAD_CONFIG=true
5 changes: 5 additions & 0 deletions packages/release/release.spec
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Source1100: systemd-tmpfiles-setup-service-debug.conf
Source1101: systemd-resolved-service-env.conf
Source1102: systemd-networkd-service-env.conf
Source1103: systemd-logind-inhibit-maxdelay.conf
Source1104: aws-config.conf

# network link rules
Source1200: 80-release.link
Expand Down Expand Up @@ -169,6 +170,9 @@ install -p -m 0644 %{S:96} %{buildroot}%{_cross_libdir}/repart.d/80-local.conf
install -d %{buildroot}%{_cross_sysctldir}
install -p -m 0644 %{S:97} %{buildroot}%{_cross_sysctldir}/80-release.conf

install -d %{buildroot}%{_cross_unitdir}/service.d
install -p -m 0644 %{S:1104} %{buildroot}%{_cross_unitdir}/service.d/00-aws-config.conf

install -d %{buildroot}%{_cross_libdir}/systemd/system.conf.d
install -p -m 0644 %{S:98} %{buildroot}%{_cross_libdir}/systemd/system.conf.d/80-release.conf

Expand Down Expand Up @@ -312,6 +316,7 @@ ln -s preconfigured.target %{buildroot}%{_cross_unitdir}/default.target
%{_cross_unitdir}/prepare-local-fs.service
%{_cross_unitdir}/deprecation-warning@.service
%{_cross_unitdir}/deprecation-warning@.timer
%{_cross_unitdir}/service.d/00-aws-config.conf
%dir %{_cross_unitdir}/systemd-resolved.service.d
%{_cross_unitdir}/systemd-resolved.service.d/00-env.conf
%dir %{_cross_unitdir}/systemd-networkd.service.d
Expand Down

0 comments on commit 7cd4cd2

Please sign in to comment.