Azure Classic
getRecommendations
Use this data source to access information about an existing Advisor Recommendations.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.Advisor.GetRecommendations.InvokeAsync(new Azure.Advisor.GetRecommendationsArgs
{
FilterByCategories =
{
"security",
"cost",
},
FilterByResourceGroups =
{
"example-resgroups",
},
}));
this.Recommendations = example.Apply(example => example.Recommendations);
}
[Output("recommendations")]
public Output<string> Recommendations { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/advisor"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := advisor.GetRecommendations(ctx, &advisor.GetRecommendationsArgs{
FilterByCategories: []string{
"security",
"cost",
},
FilterByResourceGroups: []string{
"example-resgroups",
},
}, nil)
if err != nil {
return err
}
ctx.Export("recommendations", example.Recommendations)
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = Output.of(AdvisorFunctions.getRecommendations(GetRecommendationsArgs.builder()
.filterByCategories(
"security",
"cost")
.filterByResourceGroups("example-resgroups")
.build()));
ctx.export("recommendations", example.apply(getRecommendationsResult -> getRecommendationsResult.getRecommendations()));
}
}
import pulumi
import pulumi_azure as azure
example = azure.advisor.get_recommendations(filter_by_categories=[
"security",
"cost",
],
filter_by_resource_groups=["example-resgroups"])
pulumi.export("recommendations", example.recommendations)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.advisor.getRecommendations({
filterByCategories: [
"security",
"cost",
],
filterByResourceGroups: ["example-resgroups"],
});
export const recommendations = example.then(example => example.recommendations);
variables:
example:
Fn::Invoke:
Function: azure:advisor:getRecommendations
Arguments:
filterByCategories:
- security
- cost
filterByResourceGroups:
- example-resgroups
outputs:
recommendations: ${example.recommendations}
Using getRecommendations
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRecommendations(args: GetRecommendationsArgs, opts?: InvokeOptions): Promise<GetRecommendationsResult>
function getRecommendationsOutput(args: GetRecommendationsOutputArgs, opts?: InvokeOptions): Output<GetRecommendationsResult>
def get_recommendations(filter_by_categories: Optional[Sequence[str]] = None,
filter_by_resource_groups: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetRecommendationsResult
def get_recommendations_output(filter_by_categories: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
filter_by_resource_groups: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRecommendationsResult]
func GetRecommendations(ctx *Context, args *GetRecommendationsArgs, opts ...InvokeOption) (*GetRecommendationsResult, error)
func GetRecommendationsOutput(ctx *Context, args *GetRecommendationsOutputArgs, opts ...InvokeOption) GetRecommendationsResultOutput
> Note: This function is named GetRecommendations
in the Go SDK.
public static class GetRecommendations
{
public static Task<GetRecommendationsResult> InvokeAsync(GetRecommendationsArgs args, InvokeOptions? opts = null)
public static Output<GetRecommendationsResult> Invoke(GetRecommendationsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRecommendationsResult> getRecommendations(GetRecommendationsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: azure:advisor/getRecommendations:getRecommendations
Arguments:
# Arguments dictionary
The following arguments are supported:
- Filter
By List<string>Categories Specifies a list of categories in which the Advisor Recommendations will be listed. Possible values are
HighAvailability
,Security
,Performance
,Cost
andOperationalExcellence
.- Filter
By List<string>Resource Groups Specifies a list of resource groups about which the Advisor Recommendations will be listed.
- Filter
By []stringCategories Specifies a list of categories in which the Advisor Recommendations will be listed. Possible values are
HighAvailability
,Security
,Performance
,Cost
andOperationalExcellence
.- Filter
By []stringResource Groups Specifies a list of resource groups about which the Advisor Recommendations will be listed.
- filter
By ListCategories Specifies a list of categories in which the Advisor Recommendations will be listed. Possible values are
HighAvailability
,Security
,Performance
,Cost
andOperationalExcellence
.- filter
By ListResource Groups Specifies a list of resource groups about which the Advisor Recommendations will be listed.
- filter
By string[]Categories Specifies a list of categories in which the Advisor Recommendations will be listed. Possible values are
HighAvailability
,Security
,Performance
,Cost
andOperationalExcellence
.- filter
By string[]Resource Groups Specifies a list of resource groups about which the Advisor Recommendations will be listed.
- filter_
by_ Sequence[str]categories Specifies a list of categories in which the Advisor Recommendations will be listed. Possible values are
HighAvailability
,Security
,Performance
,Cost
andOperationalExcellence
.- filter_
by_ Sequence[str]resource_ groups Specifies a list of resource groups about which the Advisor Recommendations will be listed.
- filter
By ListCategories Specifies a list of categories in which the Advisor Recommendations will be listed. Possible values are
HighAvailability
,Security
,Performance
,Cost
andOperationalExcellence
.- filter
By ListResource Groups Specifies a list of resource groups about which the Advisor Recommendations will be listed.
getRecommendations Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Recommendations
List<Get
Recommendations Recommendation> One or more
recommendations
blocks as defined below.- Filter
By List<string>Categories - Filter
By List<string>Resource Groups
- Id string
The provider-assigned unique ID for this managed resource.
- Recommendations
[]Get
Recommendations Recommendation One or more
recommendations
blocks as defined below.- Filter
By []stringCategories - Filter
By []stringResource Groups
- id String
The provider-assigned unique ID for this managed resource.
- recommendations
List
Recommendations Recommendation> One or more
recommendations
blocks as defined below.- filter
By ListCategories - filter
By ListResource Groups
- id string
The provider-assigned unique ID for this managed resource.
- recommendations
Get
Recommendations Recommendation[] One or more
recommendations
blocks as defined below.- filter
By string[]Categories - filter
By string[]Resource Groups
- id str
The provider-assigned unique ID for this managed resource.
- recommendations
Sequence[Get
Recommendations Recommendation] One or more
recommendations
blocks as defined below.- filter_
by_ Sequence[str]categories - filter_
by_ Sequence[str]resource_ groups
- id String
The provider-assigned unique ID for this managed resource.
- recommendations
List
One or more
recommendations
blocks as defined below.- filter
By ListCategories - filter
By ListResource Groups
Supporting Types
GetRecommendationsRecommendation
- Category string
The category of the recommendation.
- Description string
The description of the issue or the opportunity identified by the recommendation.
- Impact string
The business impact of the recommendation.
- Recommendation
Name string The name of the Advisor Recommendation.
- Recommendation
Type stringId The recommendation type id of the Advisor Recommendation.
- Resource
Name string The name of the identified resource of the Advisor Recommendation.
- Resource
Type string The type of the identified resource of the Advisor Recommendation.
- Suppression
Names List<string> A list of Advisor Suppression names of the Advisor Recommendation.
- Updated
Time string The most recent time that Advisor checked the validity of the recommendation..
- Category string
The category of the recommendation.
- Description string
The description of the issue or the opportunity identified by the recommendation.
- Impact string
The business impact of the recommendation.
- Recommendation
Name string The name of the Advisor Recommendation.
- Recommendation
Type stringId The recommendation type id of the Advisor Recommendation.
- Resource
Name string The name of the identified resource of the Advisor Recommendation.
- Resource
Type string The type of the identified resource of the Advisor Recommendation.
- Suppression
Names []string A list of Advisor Suppression names of the Advisor Recommendation.
- Updated
Time string The most recent time that Advisor checked the validity of the recommendation..
- category String
The category of the recommendation.
- description String
The description of the issue or the opportunity identified by the recommendation.
- impact String
The business impact of the recommendation.
- recommendation
Name String The name of the Advisor Recommendation.
- recommendation
Type StringId The recommendation type id of the Advisor Recommendation.
- resource
Name String The name of the identified resource of the Advisor Recommendation.
- resource
Type String The type of the identified resource of the Advisor Recommendation.
- suppression
Names List A list of Advisor Suppression names of the Advisor Recommendation.
- updated
Time String The most recent time that Advisor checked the validity of the recommendation..
- category string
The category of the recommendation.
- description string
The description of the issue or the opportunity identified by the recommendation.
- impact string
The business impact of the recommendation.
- recommendation
Name string The name of the Advisor Recommendation.
- recommendation
Type stringId The recommendation type id of the Advisor Recommendation.
- resource
Name string The name of the identified resource of the Advisor Recommendation.
- resource
Type string The type of the identified resource of the Advisor Recommendation.
- suppression
Names string[] A list of Advisor Suppression names of the Advisor Recommendation.
- updated
Time string The most recent time that Advisor checked the validity of the recommendation..
- category str
The category of the recommendation.
- description str
The description of the issue or the opportunity identified by the recommendation.
- impact str
The business impact of the recommendation.
- recommendation_
name str The name of the Advisor Recommendation.
- recommendation_
type_ strid The recommendation type id of the Advisor Recommendation.
- resource_
name str The name of the identified resource of the Advisor Recommendation.
- resource_
type str The type of the identified resource of the Advisor Recommendation.
- suppression_
names Sequence[str] A list of Advisor Suppression names of the Advisor Recommendation.
- updated_
time str The most recent time that Advisor checked the validity of the recommendation..
- category String
The category of the recommendation.
- description String
The description of the issue or the opportunity identified by the recommendation.
- impact String
The business impact of the recommendation.
- recommendation
Name String The name of the Advisor Recommendation.
- recommendation
Type StringId The recommendation type id of the Advisor Recommendation.
- resource
Name String The name of the identified resource of the Advisor Recommendation.
- resource
Type String The type of the identified resource of the Advisor Recommendation.
- suppression
Names List A list of Advisor Suppression names of the Advisor Recommendation.
- updated
Time String The most recent time that Advisor checked the validity of the recommendation..
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.