diff --git a/common/config/environment.go b/common/config/environment.go index c0e714a40..e221def8c 100644 --- a/common/config/environment.go +++ b/common/config/environment.go @@ -55,6 +55,8 @@ const ( DDAgentSite = "site" DDAgentMajorVersion = "majorVersion" DDAgentExtraEnvVars = "extraEnvVars" // extraEnvVars is expected in the format: =,=,... + DDAgentJMX = "jmx" + DDAgentFIPS = "fips" // Updater Namespace DDUpdaterParamName = "deploy" @@ -430,3 +432,11 @@ func (e *CommonEnvironment) GetIntWithDefault(config *sdkconfig.Config, paramNam return defaultValue } + +func (e *CommonEnvironment) AgentFIPS() bool { + return e.GetBoolWithDefault(e.AgentConfig, DDAgentFIPS, false) +} + +func (e *CommonEnvironment) AgentJMX() bool { + return e.GetBoolWithDefault(e.AgentConfig, DDAgentJMX, false) +} diff --git a/components/datadog/agent/docker.go b/components/datadog/agent/docker.go index 72f5104b3..7f82a452f 100644 --- a/components/datadog/agent/docker.go +++ b/components/datadog/agent/docker.go @@ -129,6 +129,9 @@ func dockerAgentComposeManifest(agentImagePath string, apiKey pulumi.StringInput func defaultAgentParams(params *dockeragentparams.Params) { // After setting params.FullImagePath check if you need to use JMX Docker image defer func(p *dockeragentparams.Params) { + if p.FIPS { + p.FullImagePath += "-fips" + } if p.JMX { p.FullImagePath = fmt.Sprintf("%s-jmx", p.FullImagePath) } diff --git a/components/datadog/dockeragentparams/params.go b/components/datadog/dockeragentparams/params.go index 52abcb284..6c93ec1e8 100644 --- a/components/datadog/dockeragentparams/params.go +++ b/components/datadog/dockeragentparams/params.go @@ -49,6 +49,8 @@ type Params struct { EnvironmentVariables pulumi.StringMap // PulumiDependsOn is a list of resources to depend on. PulumiDependsOn []pulumi.ResourceOption + // FIPS is true if FIPS image is needed. + FIPS bool } type Option = func(*Params) error @@ -91,6 +93,14 @@ func WithJMX() func(*Params) error { } } +// WithFIPS makes the image FIPS enabled +func WithFIPS() func(*Params) error { + return func(p *Params) error { + p.FIPS = true + return nil + } +} + func WithFullImagePath(fullImagePath string) func(*Params) error { return func(p *Params) error { p.FullImagePath = fullImagePath diff --git a/scenarios/aws/ec2/vm_run.go b/scenarios/aws/ec2/vm_run.go index 485ac3349..23935c6ce 100644 --- a/scenarios/aws/ec2/vm_run.go +++ b/scenarios/aws/ec2/vm_run.go @@ -105,6 +105,14 @@ func VMRunWithDocker(ctx *pulumi.Context) error { agentOptions = append(agentOptions, dockeragentparams.WithImageTag(env.AgentVersion())) } + if env.AgentJMX() { + agentOptions = append(agentOptions, dockeragentparams.WithJMX()) + } + + if env.AgentFIPS() { + agentOptions = append(agentOptions, dockeragentparams.WithFIPS()) + } + if env.AgentUseFakeintake() { fakeIntakeOptions := []fakeintake.Option{}